public class AccessorMaker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap |
accessors |
private CtClass |
clazz |
(package private) static java.lang.String |
lastParamType |
private int |
uniqueNumber |
Constructor and Description |
---|
AccessorMaker(CtClass c) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
findAccessorName(ClassFile cf) |
java.lang.String |
getConstructor(CtClass c,
java.lang.String desc,
MethodInfo orig) |
MethodInfo |
getFieldGetter(FieldInfo finfo,
boolean is_static)
Returns the method_info representing the added getter.
|
MethodInfo |
getFieldSetter(FieldInfo finfo,
boolean is_static)
Returns the method_info representing the added setter.
|
java.lang.String |
getMethodAccessor(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.
|
private CtClass clazz
private int uniqueNumber
private java.util.HashMap accessors
static final java.lang.String lastParamType
public AccessorMaker(CtClass c)
public java.lang.String getConstructor(CtClass c, java.lang.String desc, MethodInfo orig) throws CompileError
CompileError
public java.lang.String getMethodAccessor(java.lang.String name, java.lang.String desc, java.lang.String accDesc, MethodInfo orig) throws CompileError
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 is clazz
.
If the private method is static,
accDesc must be identical to desc
.
orig
- the method info of the private method.CompileError
public MethodInfo getFieldGetter(FieldInfo finfo, boolean is_static) throws CompileError
CompileError
public MethodInfo getFieldSetter(FieldInfo finfo, boolean is_static) throws CompileError
CompileError
private java.lang.String findAccessorName(ClassFile cf)