Class dec.trek.ExceptionHandler

The ExceptionHandler object allows you to manipulate the exception handler info of a Method.

Method Summary

  • find – returns the exception handler of the specified catch or finally statement
  • getHandlerStatement – returns the catch (or finally) Statement object associated with this exception handler
  • getTryStatement – returns the try Statement object associated with this exception handler
  • toString – returns a representation of the raw data in an ExceptionHandler object
  • toType – returns the data type of the exception being handled

Methods

public static ExceptionHandler find(Statement stmt)

Returns the ExceptionHandler object for the specified catch or finally statement.

Parameters:

stmt – the catch or finally statement whose handler is to be looked up

public Statement getHandlerStatement()

Returns the catch (or finally) Statement object associated with this exception handler.

public Statement getTryStatement()

Returns the try Statement object associated with this exception handler.

public String toString()

Returns a string containing the object's raw data: PC of try, PC of end of try, PC of handler, and either the caught exception's name or <finally>.

public String toType()

Returns the data type of the exception being handled (eg  java.lang.RuntimeException). However for a finally handler, null is returned instead.