Package org.jf.dexlib2.immutable
Class ImmutableTryBlock
java.lang.Object
org.jf.dexlib2.base.BaseTryBlock<ImmutableExceptionHandler>
org.jf.dexlib2.immutable.ImmutableTryBlock
- All Implemented Interfaces:
TryBlock<ImmutableExceptionHandler>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprivate static final ImmutableConverter<ImmutableTryBlock, TryBlock<? extends ExceptionHandler>> protected final com.google.common.collect.ImmutableList<? extends ImmutableExceptionHandler> protected final int -
Constructor Summary
ConstructorsConstructorDescriptionImmutableTryBlock(int startCodeAddress, int codeUnitCount, com.google.common.collect.ImmutableList<? extends ImmutableExceptionHandler> exceptionHandlers) ImmutableTryBlock(int startCodeAddress, int codeUnitCount, List<? extends ExceptionHandler> exceptionHandlers) -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of code units covered by this try block.com.google.common.collect.ImmutableList<? extends ImmutableExceptionHandler> A list of the exception handlers associated with this try block.intGets the code offset of the start of this try block.static com.google.common.collect.ImmutableList<ImmutableTryBlock> immutableListOf(List<? extends TryBlock<? extends ExceptionHandler>> list) static ImmutableTryBlockof(TryBlock<? extends ExceptionHandler> tryBlock) Methods inherited from class org.jf.dexlib2.base.BaseTryBlock
equals
-
Field Details
-
startCodeAddress
protected final int startCodeAddress -
codeUnitCount
protected final int codeUnitCount -
exceptionHandlers
@Nonnull protected final com.google.common.collect.ImmutableList<? extends ImmutableExceptionHandler> exceptionHandlers -
CONVERTER
private static final ImmutableConverter<ImmutableTryBlock,TryBlock<? extends ExceptionHandler>> CONVERTER
-
-
Constructor Details
-
ImmutableTryBlock
public ImmutableTryBlock(int startCodeAddress, int codeUnitCount, @Nullable List<? extends ExceptionHandler> exceptionHandlers) -
ImmutableTryBlock
public ImmutableTryBlock(int startCodeAddress, int codeUnitCount, @Nullable com.google.common.collect.ImmutableList<? extends ImmutableExceptionHandler> exceptionHandlers)
-
-
Method Details
-
of
-
getStartCodeAddress
public int getStartCodeAddress()Description copied from interface:TryBlockGets the code offset of the start of this try block. The starting location must not occur in the middle of an instruction.- Returns:
- The offset of the start of the try block from the the beginning of the bytecode for the method. The offset will be in terms of 16-bit code units.
-
getCodeUnitCount
public int getCodeUnitCount()Description copied from interface:TryBlockGets the number of code units covered by this try block. The end of the try block is typically coincident with the end of an instruction, but does not strictly need to be. If the last instruction is only partly covered by this try block, it is considered to be covered.- Returns:
- The number of code units covered by this try block.
-
getExceptionHandlers
@Nonnull public com.google.common.collect.ImmutableList<? extends ImmutableExceptionHandler> getExceptionHandlers()Description copied from interface:TryBlockA list of the exception handlers associated with this try block. The exception handlers in the returned list will all have a unique type, including at most 1 with no type, which is the catch-all handler. If present, the catch-all handler is always the last item in the list.- Returns:
- A list of ExceptionHandler objects
-
immutableListOf
@Nonnull public static com.google.common.collect.ImmutableList<ImmutableTryBlock> immutableListOf(@Nullable List<? extends TryBlock<? extends ExceptionHandler>> list)
-