public class NonPublicMemberAccessor extends PublicMemberAccessor
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 |
---|
NonPublicMemberAccessor() |
NonPublicMemberAccessor(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
callMethod(Context context,
java.lang.Class c,
java.lang.String name,
java.lang.Object[] args,
java.lang.Class[] types,
java.lang.Object target)
Call a method.
|
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.
|
void |
putField(Context context,
java.lang.Object target,
java.lang.String name,
java.lang.Object value)
Sets a field value of the specified object.
|
getObjectField, getStaticField, putObjectField, putStaticField
callConstructor, createMap, formatObject, getElement, getParent, getRange, handleUndefinedSymbol, makeArray, setElement, setRange, toCallable, toEnumeration
createList, getDefault, getDefaultImports, getInitialClassLoader, initializeOperators, invokeMethod
public NonPublicMemberAccessor()
public NonPublicMemberAccessor(Configuration conf)
public java.lang.reflect.Method[] getMethods(java.lang.Class cls)
ConfigurationAdapter
getMethods
in class PublicMemberAccessor
cls
- the classpublic java.lang.reflect.Constructor[] getConstructors(java.lang.Class cls)
ConfigurationAdapter
getConstructors
in class PublicMemberAccessor
cls
- the classprotected java.lang.reflect.Field getField(java.lang.Class cls, java.lang.String name) throws java.lang.NoSuchFieldException
getField
in class PublicMemberAccessor
java.lang.NoSuchFieldException
public java.lang.Object getField(Context context, java.lang.Object target, java.lang.String name)
getField
in class PublicMemberAccessor
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 value)
putField
in class PublicMemberAccessor
context
- the context in which the field is written.target
- the target objectname
- the field namevalue
- the field valuepublic java.lang.Object callMethod(Context context, java.lang.Class c, java.lang.String name, java.lang.Object[] args, java.lang.Class[] types, java.lang.Object target)
ConfigurationAdapter
callMethod
in class ConfigurationAdapter
context
- the contextc
- the class of the target objectname
- the name of the methodargs
- the argumentstypes
- the type information of argumentstarget
- the target of the method call