Class Handler

  • All Implemented Interfaces:
    Opcode

    public class Handler
    extends Expr
    A catch clause or a finally block.
    • Method Detail

      • where

        public CtBehavior where()
        Returns the method or constructor containing the catch clause.
        Overrides:
        where in class Expr
      • getLineNumber

        public int getLineNumber()
        Returns the source line number of the catch clause.
        Overrides:
        getLineNumber in class Expr
        Returns:
        -1 if this information is not available.
      • getFileName

        public java.lang.String getFileName()
        Returns the source file containing the catch clause.
        Overrides:
        getFileName in class Expr
        Returns:
        null if this information is not available.
      • mayThrow

        public CtClass[] mayThrow()
        Returns the list of exceptions that the catch clause may throw.
        Overrides:
        mayThrow in class Expr
      • isFinally

        public boolean isFinally()
        Returns true if this is a finally block.
      • insertBefore

        public void insertBefore​(java.lang.String src)
                          throws CannotCompileException
        Inserts bytecode at the beginning of the catch clause. The caught exception is stored in $1.
        Parameters:
        src - the source code representing the inserted bytecode. It must be a single statement or block.
        Throws:
        CannotCompileException