|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpnuts.lang.Configuration
pnuts.ext.ConfigurationAdapter
pnuts.ext.PublicMemberAccessor
public class PublicMemberAccessor
when -p option is given to the pnuts command, this class is used so that public members can be accessed.
Field Summary |
---|
Fields inherited from class pnuts.ext.ConfigurationAdapter |
---|
base |
Fields inherited from class pnuts.lang.Configuration |
---|
_add, _add1, _and, _divide, _eq, _ge, _gt, _le, _lt, _mod, _multiply, _negate, _not, _or, _shiftArithmetic, _shiftLeft, _shiftRight, _subtract, _subtract1, _xor, normalConfiguration |
Constructor Summary | |
---|---|
PublicMemberAccessor()
|
|
PublicMemberAccessor(Configuration conf)
|
Method Summary | |
---|---|
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. |
Methods inherited from class pnuts.ext.ConfigurationAdapter |
---|
callConstructor, callMethod, createMap, formatObject, getElement, getParent, getRange, handleUndefinedSymbol, makeArray, setElement, setRange, toCallable, toEnumeration |
Methods inherited from class pnuts.lang.Configuration |
---|
createList, getDefault, getDefaultImports, getInitialClassLoader, initializeOperators, invokeMethod |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PublicMemberAccessor()
public PublicMemberAccessor(Configuration conf)
Method Detail |
---|
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 name
public 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 field
public 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 class
public java.lang.reflect.Constructor[] getConstructors(java.lang.Class cls)
ConfigurationAdapter
getConstructors
in class ConfigurationAdapter
cls
- the class
protected java.lang.reflect.Field getField(java.lang.Class cls, java.lang.String name) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |