public class ConfigurationAdapter extends Configuration
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
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 |
|---|
ConfigurationAdapter()
Constructor
|
ConfigurationAdapter(Configuration base)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
callConstructor(Context context,
java.lang.Class c,
java.lang.Object[] args,
java.lang.Class[] types)
Call a constructor.
|
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.util.Map |
createMap(int size,
Context context)
Create a new Map object that corresponds to {key=>value} expression.
|
java.lang.String |
formatObject(java.lang.Object target)
String representation of an object
|
java.lang.reflect.Constructor[] |
getConstructors(java.lang.Class cls)
Get all public constructors of the specified class.
|
java.lang.Object |
getElement(Context context,
java.lang.Object target,
java.lang.Object key)
Gets an array element
|
java.lang.Object |
getField(Context context,
java.lang.Object target,
java.lang.String name)
Gets a field of the specified class.
|
java.lang.reflect.Method[] |
getMethods(java.lang.Class cls)
Get all public methods of the specified class.
|
Configuration |
getParent()
Returns the parent configuration
|
java.lang.Object |
getRange(Context context,
java.lang.Object target,
java.lang.Object idx1,
java.lang.Object idx2)
Defines the semantices of an expression like:
|
java.lang.Object |
getStaticField(Context context,
java.lang.Class clazz,
java.lang.String name)
Get the value of a static field.
|
java.lang.Object |
handleUndefinedSymbol(java.lang.String symbol,
Context context)
Handle an "not.defined" error
This method can be redefined by a subclass so that a special value (e.g.
|
java.lang.Object |
makeArray(java.lang.Object[] array,
Context context)
Return the value of an array expression.
|
void |
putField(Context context,
java.lang.Object target,
java.lang.String name,
java.lang.Object value)
Sets a field of the specified class.
|
void |
putStaticField(Context context,
java.lang.Class clazz,
java.lang.String name,
java.lang.Object value)
Sets a field of the specified class.
|
void |
setElement(Context context,
java.lang.Object target,
java.lang.Object key,
java.lang.Object value)
Sets an array element
|
java.lang.Object |
setRange(Context context,
java.lang.Object target,
java.lang.Object idx1,
java.lang.Object idx2,
java.lang.Object value)
Defines the semantices of an expression like:
|
Callable |
toCallable(java.lang.Object obj)
Convert an object to Callable.
|
java.util.Enumeration |
toEnumeration(java.lang.Object obj)
Convert an object to Enumeration.
|
createList, getDefault, getDefaultImports, getInitialClassLoader, initializeOperators, invokeMethodprotected Configuration base
public ConfigurationAdapter()
public ConfigurationAdapter(Configuration base)
base - the base configurationpublic Configuration getParent()
public java.lang.Object getField(Context context, java.lang.Object target, java.lang.String name)
getField in class Configurationtarget - the target objecgtname - the field namecontext - the context in which the field is readpublic void putField(Context context, java.lang.Object target, java.lang.String name, java.lang.Object value)
putField in class Configurationcontext - the context in which the field is written.target - the target objecgtname - the field namevalue - the field valuepublic java.lang.Object getStaticField(Context context, java.lang.Class clazz, java.lang.String name)
getStaticField in class Configurationcontext - 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)
putStaticField in class Configurationcontext - 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.Object callMethod(Context context, java.lang.Class c, java.lang.String name, java.lang.Object[] args, java.lang.Class[] types, java.lang.Object target)
callMethod in class Configurationcontext - 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 callpublic java.lang.Object callConstructor(Context context, java.lang.Class c, java.lang.Object[] args, java.lang.Class[] types)
callConstructor in class Configurationargs - the argumentscontext - the contextc - class of the constructortypes - type information of each argumentspublic java.lang.Object getElement(Context context, java.lang.Object target, java.lang.Object key)
getElement in class Configurationtarget - the target object (an array)key - a key or an index of the elementcontext - the contextpublic void setElement(Context context, java.lang.Object target, java.lang.Object key, java.lang.Object value)
setElement in class Configurationtarget - the target object (an array)key - a key or an index of the elementvalue - the new value of the elementcontext - the contextpublic java.lang.reflect.Method[] getMethods(java.lang.Class cls)
getMethods in class Configurationcls - the classpublic java.lang.reflect.Constructor[] getConstructors(java.lang.Class cls)
getConstructors in class Configurationcls - the classpublic java.util.Enumeration toEnumeration(java.lang.Object obj)
toEnumeration in class Configurationpublic Callable toCallable(java.lang.Object obj)
toCallable in class Configurationpublic java.lang.Object handleUndefinedSymbol(java.lang.String symbol,
Context context)
handleUndefinedSymbol in class Configurationsymbol - the undefined symbolcontext - the context in which the symbol is referencedpublic java.lang.Object makeArray(java.lang.Object[] array,
Context context)
makeArray in class Configurationarray - the elements in the array expressioncontext - the contextpublic java.util.Map createMap(int size,
Context context)
createMap in class Configurationsize - the map sizepublic java.lang.String formatObject(java.lang.Object target)
formatObject in class Configurationtarget - the target object to printpublic java.lang.Object getRange(Context context, java.lang.Object target, java.lang.Object idx1, java.lang.Object idx2)
target[idx1..idx2]
getRange in class Configurationcontext - the contexttarget - the target objectidx1 - the start indexidx2 - the end index. null in idx2 means open-ended.public java.lang.Object setRange(Context context, java.lang.Object target, java.lang.Object idx1, java.lang.Object idx2, java.lang.Object value)
target[idx1..idx2] = value
setRange in class Configurationcontext - the context in which the assignment is donetarget - the target objectidx1 - the start indexidx2 - the end index. null in idx2 means open-ended.value - the new value of the indexed element