Package javassist.compiler
Class AccessorMaker
- java.lang.Object
-
- javassist.compiler.AccessorMaker
-
public class AccessorMaker extends java.lang.ObjectAccessorMaker maintains accessors to private members of an enclosing class. It is necessary for compiling a method in an inner class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMapaccessorsprivate CtClassclazz(package private) static java.lang.StringlastParamTypeprivate intuniqueNumber
-
Constructor Summary
Constructors Constructor Description AccessorMaker(CtClass c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringfindAccessorName(ClassFile cf)java.lang.StringgetConstructor(CtClass c, java.lang.String desc, MethodInfo orig)MethodInfogetFieldGetter(FieldInfo finfo, boolean is_static)Returns the method_info representing the added getter.MethodInfogetFieldSetter(FieldInfo finfo, boolean is_static)Returns the method_info representing the added setter.java.lang.StringgetMethodAccessor(java.lang.String name, java.lang.String desc, java.lang.String accDesc, MethodInfo orig)Returns the name of the method for accessing a private method.
-
-
-
Field Detail
-
clazz
private CtClass clazz
-
uniqueNumber
private int uniqueNumber
-
accessors
private java.util.HashMap accessors
-
lastParamType
static final java.lang.String lastParamType
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccessorMaker
public AccessorMaker(CtClass c)
-
-
Method Detail
-
getConstructor
public java.lang.String getConstructor(CtClass c, java.lang.String desc, MethodInfo orig) throws CompileError
- Throws:
CompileError
-
getMethodAccessor
public java.lang.String getMethodAccessor(java.lang.String name, java.lang.String desc, java.lang.String accDesc, MethodInfo orig) throws CompileErrorReturns the name of the method for accessing a private method.- Parameters:
name- the name of the private method.desc- the descriptor of the private method.accDesc- the descriptor of the accessor method. The first parameter type isclazz. If the private method is static,accDescmust be identical todesc.orig- the method info of the private method.- Returns:
- Throws:
CompileError
-
getFieldGetter
public MethodInfo getFieldGetter(FieldInfo finfo, boolean is_static) throws CompileError
Returns the method_info representing the added getter.- Throws:
CompileError
-
getFieldSetter
public MethodInfo getFieldSetter(FieldInfo finfo, boolean is_static) throws CompileError
Returns the method_info representing the added setter.- Throws:
CompileError
-
findAccessorName
private java.lang.String findAccessorName(ClassFile cf)
-
-