Package org.jf.dexlib2.iface
Interface ExceptionHandler
-
- All Superinterfaces:
java.lang.Comparable<ExceptionHandler>
- All Known Implementing Classes:
BaseExceptionHandler,BuilderExceptionHandler,BuilderExceptionHandler,DexBackedCatchAllExceptionHandler,DexBackedExceptionHandler,DexBackedTypedExceptionHandler,ExceptionHandlerRewriter.RewrittenExceptionHandler,ImmutableExceptionHandler
public interface ExceptionHandler extends java.lang.Comparable<ExceptionHandler>
This class represents an individual exception handler entry, in a try block.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompareTo(ExceptionHandler o)Compare this ExceptionHandler to another ExceptionHandler.booleanequals(java.lang.Object o)Compares this ExceptionHandler to another ExceptionHandler for equality.java.lang.StringgetExceptionType()Gets the type of exception that is handled by this handler.TypeReferencegetExceptionTypeReference()Gets the type of exception that is handled by this handler.intgetHandlerCodeAddress()Gets the code offset of the handler.inthashCode()Returns a hashcode for this ExceptionHandler.
-
-
-
Method Detail
-
getExceptionType
@Nullable java.lang.String getExceptionType()
Gets the type of exception that is handled by this handler.- Returns:
- The type of exception that is handled by this handler, or null if this is a catch-all handler.
-
getExceptionTypeReference
@Nullable TypeReference getExceptionTypeReference()
Gets the type of exception that is handled by this handler.- Returns:
- A TypeReference to the type of exception that is handled by this handler, or null if this is a catch-all handler.
-
getHandlerCodeAddress
int getHandlerCodeAddress()
Gets the code offset of the handler.- Returns:
- The offset of the handler from the the beginning of the bytecode for the method. The offset will be in terms of 16-bit code units
-
hashCode
int hashCode()
Returns a hashcode for this ExceptionHandler. This hashCode is defined to be the following:String exceptionType = getExceptionType(); int hashCode = exceptionType==null?0:exceptionType.hashCode(); return hashCode*31 + getHandlerCodeAddress();- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code value for this ExceptionHandler
-
equals
boolean equals(@Nullable java.lang.Object o)Compares this ExceptionHandler to another ExceptionHandler for equality. This ExceptionHandler is equal to another ExceptionHandler if all of it's "fields" are equal. That is, if the return values of getExceptionType() and getHandlerCodeAddress() are both equal.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- The object to be compared for equality with this ExceptionHandler- Returns:
- true if the specified object is equal to this ExceptionHandler
-
compareTo
int compareTo(@Nonnull ExceptionHandler o)Compare this ExceptionHandler to another ExceptionHandler. The comparison is based on the comparison of the return values of getExceptionType() and getHandlerCodeAddress() in that order. A null value for getExceptionType() compares after a non-null value.- Specified by:
compareToin interfacejava.lang.Comparable<ExceptionHandler>- Parameters:
o- The ExceptionHandler to compare with this ExceptionHandler- Returns:
- An integer representing the result of the comparison
-
-