public class PublicMemberAccessor extends ConfigurationAdapter
base
_add, _add1, _and, _divide, _eq, _ge, _gt, _le, _lt, _mod, _multiply, _negate, _not, _or, _shiftArithmetic, _shiftLeft, _shiftRight, _subtract, _subtract1, _xor, normalConfiguration
Constructor and Description |
---|
PublicMemberAccessor() |
PublicMemberAccessor(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Constructor[] |
getConstructors(java.lang.Class cls)
Get all public constructors of the specified class.
|
protected java.lang.reflect.Field |
getField(java.lang.Class cls,
java.lang.String name) |
java.lang.Object |
getField(Context context,
java.lang.Object target,
java.lang.String name)
Gets a field value of the target object.
|
java.lang.reflect.Method[] |
getMethods(java.lang.Class cls)
Get all public methods of the specified class.
|
protected java.lang.Object |
getObjectField(Context context,
java.lang.Object target,
java.lang.String name) |
java.lang.Object |
getStaticField(Context context,
java.lang.Class clazz,
java.lang.String name)
Get the value of a static field.
|
void |
putField(Context context,
java.lang.Object target,
java.lang.String name,
java.lang.Object expr)
Sets a field value of the specified object.
|
protected void |
putObjectField(Context context,
java.lang.Object target,
java.lang.String name,
java.lang.Object value) |
void |
putStaticField(Context context,
java.lang.Class clazz,
java.lang.String name,
java.lang.Object value)
Sets a field of the specified class.
|
callConstructor, callMethod, createMap, formatObject, getElement, getParent, getRange, handleUndefinedSymbol, makeArray, setElement, setRange, toCallable, toEnumeration
createList, getDefault, getDefaultImports, getInitialClassLoader, initializeOperators, invokeMethod
public PublicMemberAccessor()
public PublicMemberAccessor(Configuration conf)
public java.lang.Object getField(Context context, java.lang.Object target, java.lang.String name)
getField
in class ConfigurationAdapter
context
- the context in which the field is readtarget
- the target objectname
- the field namepublic void putField(Context context, java.lang.Object target, java.lang.String name, java.lang.Object expr)
putField
in class ConfigurationAdapter
context
- the context in which the field is written.target
- the target objectname
- the field nameexpr
- the field valueprotected java.lang.Object getObjectField(Context context, java.lang.Object target, java.lang.String name)
protected void putObjectField(Context context, java.lang.Object target, java.lang.String name, java.lang.Object value)
public java.lang.Object getStaticField(Context context, java.lang.Class clazz, java.lang.String name)
ConfigurationAdapter
getStaticField
in class ConfigurationAdapter
context
- the context in which the field is accessedclazz
- the class in which the static field is definedname
- the name of the static fieldpublic void putStaticField(Context context, java.lang.Class clazz, java.lang.String name, java.lang.Object value)
ConfigurationAdapter
putStaticField
in class ConfigurationAdapter
context
- the context in which the field is written.clazz
- the class in which the static field is definedname
- the field namevalue
- the field valuepublic java.lang.reflect.Method[] getMethods(java.lang.Class cls)
ConfigurationAdapter
getMethods
in class ConfigurationAdapter
cls
- the classpublic java.lang.reflect.Constructor[] getConstructors(java.lang.Class cls)
ConfigurationAdapter
getConstructors
in class ConfigurationAdapter
cls
- the classprotected java.lang.reflect.Field getField(java.lang.Class cls, java.lang.String name) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException