| Package | Description | 
|---|---|
| javassist | The Javassist Core API. | 
| javassist.compiler | |
| javassist.compiler.ast | |
| javassist.convert | |
| javassist.expr | This package contains the classes for modifying a method body. | 
| Modifier and Type | Method and Description | 
|---|---|
| CtField | CtClass. getDeclaredField(String name)Retrieves the field with the specified name among the fields
 declared in the class. | 
| CtField | CtClass. getDeclaredField(String name,
                String desc)Retrieves the field with the specified name and type among the fields
 declared in the class. | 
| CtField[] | CtClass. getDeclaredFields()Gets all the fields declared in the class. | 
| CtField | CtClass. getField(String name)Returns the field with the specified name. | 
| CtField | CtClass. getField(String name,
        String desc)Returns the field with the specified name and type. | 
| CtField[] | CtClass. getFields()Returns an array containing  CtFieldobjects
 representing all the non-private fields of the class. | 
| static CtField | CtField. make(String src,
    CtClass declaring)Compiles the given source code and creates a field. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | CtClass. addField(CtField f)Adds a field. | 
| void | CtClass. addField(CtField f,
        CtField.Initializer init)Adds a field with an initial value. | 
| void | CtClass. addField(CtField f,
        String init)Adds a field with an initial value. | 
| static CtMethod | CtNewMethod. getter(String methodName,
      CtField field)Creates a public getter method. | 
| void | CodeConverter. redirectFieldAccess(CtField field,
                   CtClass newClass,
                   String newFieldname)Modify a method body so that field read/write expressions access
 a different field from the original one. | 
| void | CtClass. removeField(CtField f)Removes a field declared in this class. | 
| void | CodeConverter. replaceFieldRead(CtField field,
                CtClass calledClass,
                String calledMethod)Modify a method body so that an expression reading the specified
 field is replaced with a call to the specified static method. | 
| void | CodeConverter. replaceFieldWrite(CtField field,
                 CtClass calledClass,
                 String calledMethod)Modify a method body so that an expression writing the specified
 field is replaced with a call to the specified static method. | 
| static CtMethod | CtNewMethod. setter(String methodName,
      CtField field)Creates a public setter method. | 
| Constructor and Description | 
|---|
| CtField(CtField src,
       CtClass declaring)Creates a copy of the given field. | 
| Modifier and Type | Class and Description | 
|---|---|
| static class  | Javac.CtFieldWithInit | 
| Modifier and Type | Method and Description | 
|---|---|
| protected CtField | TypeChecker. fieldAccess(ASTree expr) | 
| protected CtField | MemberCodeGen. fieldAccess(ASTree expr,
           boolean acceptLength) | 
| CtField | MemberResolver. lookupField(String className,
           Symbol fieldName) | 
| CtField | MemberResolver. lookupFieldByJvmName(String jvmClassName,
                    Symbol fieldName) | 
| CtField | MemberResolver. lookupFieldByJvmName2(String jvmClassName,
                     Symbol fieldSym,
                     ASTree expr)Only used by fieldAccess() in MemberCodeGen and TypeChecker. | 
| Modifier and Type | Method and Description | 
|---|---|
| static ASTree | TypeChecker. getConstantFieldValue(CtField f) | 
| Modifier and Type | Method and Description | 
|---|---|
| CtField | Member. getField() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | Member. setField(CtField f) | 
| Constructor and Description | 
|---|
| TransformFieldAccess(Transformer next,
                    CtField field,
                    String newClassname,
                    String newFieldname) | 
| TransformReadField(Transformer next,
                  CtField field,
                  String methodClassname,
                  String methodName) | 
| TransformWriteField(Transformer next,
                   CtField field,
                   String methodClassname,
                   String methodName) | 
| Modifier and Type | Method and Description | 
|---|---|
| CtField | FieldAccess. getField()Returns the field accessed by this expression. | 
Copyright © 2016 Shigeru Chiba, www.javassist.org. All Rights Reserved.