Class Instanceof

java.lang.Object
javassist.expr.Expr
javassist.expr.Instanceof
All Implemented Interfaces:
Opcode

public class Instanceof extends Expr
Instanceof operator.
  • Method Details

    • where

      public CtBehavior where()
      Returns the method or constructor containing the instanceof expression represented by this object.
      Overrides:
      where in class Expr
    • getLineNumber

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

      public String getFileName()
      Returns the source file containing the instanceof expression.
      Overrides:
      getFileName in class Expr
      Returns:
      null if this information is not available.
    • getType

      public CtClass getType() throws NotFoundException
      Returns the CtClass object representing the type name on the right hand side of the instanceof operator.
      Throws:
      NotFoundException
    • mayThrow

      public CtClass[] mayThrow()
      Returns the list of exceptions that the expression may throw. This list includes both the exceptions that the try-catch statements including the expression can catch and the exceptions that the throws declaration allows the method to throw.
      Overrides:
      mayThrow in class Expr
    • replace

      public void replace(String statement) throws CannotCompileException
      Replaces the instanceof operator with the bytecode derived from the given source text.

      $0 is available but the value is null.

      Specified by:
      replace in class Expr
      Parameters:
      statement - a Java statement except try-catch.
      Throws:
      CannotCompileException