Package org.jf.dexlib2.iface
Interface ExceptionHandler
- All Superinterfaces:
Comparable<ExceptionHandler>
- All Known Implementing Classes:
BaseExceptionHandler,BuilderExceptionHandler,BuilderExceptionHandler,DexBackedCatchAllExceptionHandler,DexBackedExceptionHandler,DexBackedTypedExceptionHandler,ExceptionHandlerRewriter.RewrittenExceptionHandler,ImmutableExceptionHandler
This class represents an individual exception handler entry, in a try block.
-
Method Summary
Modifier and TypeMethodDescriptionintCompare this ExceptionHandler to another ExceptionHandler.booleanCompares this ExceptionHandler to another ExceptionHandler for equality.Gets the type of exception that is handled by this handler.Gets the type of exception that is handled by this handler.intGets the code offset of the handler.inthashCode()Returns a hashcode for this ExceptionHandler.
-
Method Details
-
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
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(); -
equals
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. -
compareTo
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 interfaceComparable<ExceptionHandler>- Parameters:
o- The ExceptionHandler to compare with this ExceptionHandler- Returns:
- An integer representing the result of the comparison
-