Top Description Fields Constructors Methods
javassist.compiler

public Class AccessorMaker

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, javassist.CannotCompileException, .ClassPool, .CtClass, .NotFoundException, javassist.bytecode.AccessFlag, .Bytecode, .ClassFile, .ConstPool, .Descriptor, .ExceptionsAttribute, .FieldInfo, .MethodInfo, .SyntheticAttribute

AccessorMaker maintains accessors to private members of an enclosing class. It is necessary for compiling a method in an inner class.

Field Summary

Modifier and TypeField and Description
private Map<String, Object>
private CtClass
pack-priv static final String
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
public String
public MethodInfo
getFieldGetter(FieldInfo finfo, boolean is_static)

Returns the method_info representing the added getter.

public MethodInfo
getFieldSetter(FieldInfo finfo, boolean is_static)

Returns the method_info representing the added setter.

public String
getMethodAccessor(String
the name of the private method.
name
,
String
the descriptor of the private method.
desc
,
String
the descriptor of the accessor method. The first parameter type is clazz. If the private method is static, accDesc must be identical to desc.
accDesc
,
MethodInfo
the method info of the private method.
orig
)

Returns the name of the method for accessing a private method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessorsback to summary
private Map<String, Object> accessors
clazzback to summary
private CtClass clazz
lastParamTypeback to summary
pack-priv static final String lastParamType
uniqueNumberback to summary
private int uniqueNumber

Constructor Detail

AccessorMakerback to summary
public AccessorMaker(CtClass c)

Method Detail

findAccessorNameback to summary
private String findAccessorName(ClassFile cf)
getConstructorback to summary
public String getConstructor(CtClass c, String desc, MethodInfo orig) throws CompileError
getFieldGetterback to summary
public MethodInfo getFieldGetter(FieldInfo finfo, boolean is_static) throws CompileError

Returns the method_info representing the added getter.

getFieldSetterback to summary
public MethodInfo getFieldSetter(FieldInfo finfo, boolean is_static) throws CompileError

Returns the method_info representing the added setter.

getMethodAccessorback to summary
public String getMethodAccessor(String name, String desc, String accDesc, MethodInfo orig) throws CompileError

Returns the name of the method for accessing a private method.

Parameters
name:String

the name of the private method.

desc:String

the descriptor of the private method.

accDesc:String

the descriptor of the accessor method. The first parameter type is clazz. If the private method is static, accDesc must be identical to desc.

orig:MethodInfo

the method info of the private method.