| Package | Description | 
|---|---|
| javassist | The Javassist Core API. | 
| javassist.bytecode | Bytecode-level API. | 
| javassist.bytecode.analysis | Bytecode Analysis API. | 
| javassist.compiler | |
| javassist.convert | |
| javassist.expr | This package contains the classes for modifying a method body. | 
| javassist.tools.reflect | Runtime Behavioral Reflection. | 
| Modifier and Type | Method and Description | 
|---|---|
| static CtMethod | CtNewMethod. abstractMethod(CtClass returnType,
              String mname,
              CtClass[] parameters,
              CtClass[] exceptions,
              CtClass declaring)Creates a public abstract method. | 
| static CtMethod | CtNewMethod. copy(CtMethod src,
    CtClass declaring,
    ClassMap map)Creates a copy of a method. | 
| static CtMethod | CtNewMethod. copy(CtMethod src,
    String name,
    CtClass declaring,
    ClassMap map)Creates a copy of a method with a new name. | 
| static CtMethod | CtNewMethod. delegator(CtMethod delegate,
         CtClass declaring)Creates a method forwarding to a delegate in
 a super class. | 
| CtMethod | CtClass. getDeclaredMethod(String name)Retrieves the method with the specified name among the methods
 declared in the class. | 
| CtMethod | CtClass. getDeclaredMethod(String name,
                 CtClass[] params)Retrieves the method with the specified name and parameter types
 among the methods declared in the class. | 
| CtMethod[] | CtClass. getDeclaredMethods()Gets all methods declared in the class. | 
| CtMethod[] | CtClass. getDeclaredMethods(String name)Retrieves methods with the specified name among the methods
 declared in the class. | 
| CtMethod | CtClass. getEnclosingMethod()Deprecated. 
 The enclosing method might be a constructor.
             Use  CtClass.getEnclosingBehavior(). | 
| CtMethod | CtClass. getMethod(String name,
         String desc)Returns the method with the given name and signature. | 
| CtMethod | ClassPool. getMethod(String classname,
         String methodname)Reads a class file and obtains a compile-time method. | 
| CtMethod[] | CtClass. getMethods()Returns an array containing  CtMethodobjects
 representing all the non-private methods of the class. | 
| static CtMethod | CtNewMethod. getter(String methodName,
      CtField field)Creates a public getter method. | 
| static CtMethod | CtNewMethod. make(CtClass returnType,
    String mname,
    CtClass[] parameters,
    CtClass[] exceptions,
    String body,
    CtClass declaring)Creates a public (non-static) method. | 
| static CtMethod | CtNewMethod. make(int modifiers,
    CtClass returnType,
    String mname,
    CtClass[] parameters,
    CtClass[] exceptions,
    String body,
    CtClass declaring)Creates a method. | 
| static CtMethod | CtMethod. make(MethodInfo minfo,
    CtClass declaring)Creates a method from a  MethodInfoobject. | 
| static CtMethod | CtMethod. make(String src,
    CtClass declaring)Compiles the given source code and creates a method. | 
| static CtMethod | CtNewMethod. make(String src,
    CtClass declaring)Compiles the given source code and creates a method. | 
| static CtMethod | CtNewMethod. make(String src,
    CtClass declaring,
    String delegateObj,
    String delegateMethod)Compiles the given source code and creates a method. | 
| static CtMethod | CtNewMethod. setter(String methodName,
      CtField field)Creates a public setter method. | 
| CtMethod | CtConstructor. toMethod(String name,
        CtClass declaring)Makes a copy of this constructor and converts it into a method. | 
| CtMethod | CtConstructor. toMethod(String name,
        CtClass declaring,
        ClassMap map)Makes a copy of this constructor and converts it into a method. | 
| static CtMethod | CtNewMethod. wrapped(CtClass returnType,
       String mname,
       CtClass[] parameterTypes,
       CtClass[] exceptionTypes,
       CtMethod body,
       CtMethod.ConstParameter constParam,
       CtClass declaring)Creates a wrapped method. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | CtClass. addMethod(CtMethod m)Adds a method. | 
| static CtMethod | CtNewMethod. copy(CtMethod src,
    CtClass declaring,
    ClassMap map)Creates a copy of a method. | 
| static CtMethod | CtNewMethod. copy(CtMethod src,
    String name,
    CtClass declaring,
    ClassMap map)Creates a copy of a method with a new name. | 
| static CtMethod | CtNewMethod. delegator(CtMethod delegate,
         CtClass declaring)Creates a method forwarding to a delegate in
 a super class. | 
| void | CodeConverter. insertAfterMethod(CtMethod origMethod,
                 CtMethod afterMethod)Inserts a call to another method after an existing method call. | 
| void | CodeConverter. insertBeforeMethod(CtMethod origMethod,
                  CtMethod beforeMethod)Insert a call to another method before an existing method call. | 
| static CtConstructor | CtNewConstructor. make(CtClass[] parameters,
    CtClass[] exceptions,
    int howto,
    CtMethod body,
    CtMethod.ConstParameter cparam,
    CtClass declaring)Creates a public constructor. | 
| void | CodeConverter. redirectMethodCall(CtMethod origMethod,
                  CtMethod substMethod)Modify method invocations in a method body so that a different
 method will be invoked. | 
| void | CodeConverter. redirectMethodCall(String oldMethodName,
                  CtMethod newMethod)Correct invocations to a method that has been renamed. | 
| void | CtClass. removeMethod(CtMethod m)Removes a method declared in this class. | 
| void | CtMethod. setBody(CtMethod src,
       ClassMap map)Copies a method body from another method. | 
| void | CtMethod. setWrappedBody(CtMethod mbody,
              CtMethod.ConstParameter constParam)Replace a method body with a new method body wrapping the
 given method. | 
| static CtMethod | CtNewMethod. wrapped(CtClass returnType,
       String mname,
       CtClass[] parameterTypes,
       CtClass[] exceptionTypes,
       CtMethod body,
       CtMethod.ConstParameter constParam,
       CtClass declaring)Creates a wrapped method. | 
| Constructor and Description | 
|---|
| CtMethod(CtMethod src,
        CtClass declaring,
        ClassMap map)Creates a copy of a  CtMethodobject. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | InstructionPrinter. print(CtMethod method)Prints the bytecode instructions of a given method. | 
| static void | InstructionPrinter. print(CtMethod method,
     PrintStream stream)Prints the bytecode instructions of a given method. | 
| Modifier and Type | Method and Description | 
|---|---|
| Frame[] | Analyzer. analyze(CtMethod method)Performs data-flow analysis on a method and returns an array, indexed by
 instruction position, containing the starting frame state of all reachable
 instructions. | 
| void | FramePrinter. print(CtMethod method)Prints the instructions and the frame states of the given method. | 
| Constructor and Description | 
|---|
| ControlFlow(CtMethod method)Constructs a control-flow analyzer for the given method. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | MemberCodeGen. setThisMethod(CtMethod m)Records the currently compiled method. | 
| Constructor and Description | 
|---|
| TransformAfter(Transformer next,
              CtMethod origMethod,
              CtMethod afterMethod) | 
| TransformBefore(Transformer next,
               CtMethod origMethod,
               CtMethod beforeMethod) | 
| TransformCall(Transformer next,
             CtMethod origMethod,
             CtMethod substMethod) | 
| TransformCall(Transformer next,
             String oldMethodName,
             CtMethod substMethod) | 
| Modifier and Type | Method and Description | 
|---|---|
| CtMethod | MethodCall. getMethod()Returns the called method. | 
| CtMethod | ConstructorCall. getMethod()Always throws a  NotFoundException. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected CtMethod | Reflection. trapMethod | 
| protected CtMethod | Reflection. trapRead | 
| protected CtMethod | Reflection. trapStaticMethod | 
| protected CtMethod | Reflection. trapWrite | 
Copyright © 2016 Shigeru Chiba, www.javassist.org. All Rights Reserved.