public class DynamicRuntime extends Runtime
Modifier and Type | Class and Description |
---|---|
protected static class |
DynamicRuntime.DynamicAccessor |
Runtime.Accessor, Runtime.Break, Runtime.Continue, Runtime.FunctionSerializer, Runtime.TypeMap
BOOLEAN_SYMBOL, BYTE_SYMBOL, CHAR_SYMBOL, CLONE, DOUBLE_SYMBOL, EXCEPTOIN_FIELD_SYMBOL, FLOAT_SYMBOL, INT_SYMBOL, LONG_SYMBOL, SHORT_SYMBOL, VOID_SYMBOL
Constructor and Description |
---|
DynamicRuntime() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
_callConstructor(Context context,
java.lang.Class c,
java.lang.Object[] args,
java.lang.Class[] types)
Call a constructor
|
protected java.lang.Object |
_callConstructor(Context context,
java.lang.Class c,
java.lang.Object[] args,
java.lang.Class[] types,
pnuts.compiler.CodeLoader codeLoader) |
protected 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.Object |
getBeanProperty(java.lang.Object target,
java.lang.String name)
Gets a Bean property of the specified bean.
|
protected java.lang.Object |
getBeanProperty(java.lang.Object target,
java.lang.String name,
java.lang.Class stopClass)
Gets a Bean property of the specified bean.
|
java.lang.Class |
getBeanPropertyType(java.lang.Class cls,
java.lang.String name)
Gets the type of a bean property
|
static PnutsFunction |
makeProxy(java.lang.reflect.Constructor cons)
This method maps a proxy object of a Constructor to a PnutsFunction.
|
static PnutsFunction |
makeProxy(java.lang.reflect.Method method)
This method maps a proxy object of a Method to a PnutsFunction.
|
void |
setBeanProperty(java.lang.Object target,
java.lang.String name,
java.lang.Object value)
Sets a Bean property of the specified bean.
|
protected void |
setBeanProperty(java.lang.Object target,
java.lang.String name,
java.lang.Object value,
java.lang.Class stopClass)
Sets a Bean property of the specified bean.
|
add, add, add1, add1, addImport, addStaticMembers, and, and, applyGenerator, arraydim, arrayType, call, call, callConstructor, callFunction, callMethod, cast, catchException, checkException, checkException, compareObjects, compareTo, compareTo, createList, createMap, defineTopLevelFunction, defineUnboundFunction, divide, divide, eq, eq, escape, exec, execute, fileToURL, findCallableMethod, format, format, ge, ge, getArrayLength, getBeanProperty, getBeginColumn, getBeginLine, getBottomType, getCompiledScript, getConstructors, getElement, getElementAt, getEndLine, getField, getField, getFunction, getFunction, getFunctions, getMessage, getMethods, getProperty, getRange, getRuntime, getScriptReader, getScriptSource, getScriptURL, getStaticField, getThreadContext, gt, gt, isArray, isGenerator, jump, le, le, loadNode, lt, lt, makeArray, matchType, mod, mod, multiply, multiply, ne, ne, negate, negate, newInstance, not, not, or, or, parseChar, parseFloat, parseInt, parseString, primitive, printError, putField, putStaticField, quantity, replaceChar, run, saveNode, setBeanProperty, setElement, setExitHook, setLine, setLine, setPackage, setRange, setThreadContext, shiftArithmetic, shiftArithmetic, shiftLeft, shiftLeft, shiftRight, shiftRight, subtract, subtract, subtract1, subtract1, throwException, toBoolean, toEnumeration, transform, transform, unparse, xor, xor
protected 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 Runtime
context
- the contextc
- the class of methodname
- the method nameargs
- the paramterstypes
- the types of the formal argumentstarget
- the target objectprotected java.lang.Object _callConstructor(Context context, java.lang.Class c, java.lang.Object[] args, java.lang.Class[] types)
Runtime
_callConstructor
in class Runtime
context
- the context in which the constructor is calledc
- the class of methodargs
- the paramterstypes
- the types of the formal argumentsprotected java.lang.Object _callConstructor(Context context, java.lang.Class c, java.lang.Object[] args, java.lang.Class[] types, pnuts.compiler.CodeLoader codeLoader) throws java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
public static PnutsFunction makeProxy(java.lang.reflect.Constructor cons)
cons
- a constructorpublic static PnutsFunction makeProxy(java.lang.reflect.Method method)
method
- a methodpublic java.lang.Object getBeanProperty(java.lang.Object target, java.lang.String name) throws java.lang.IllegalAccessException
getBeanProperty
in class Runtime
target
- the target beanname
- the Bean property namejava.lang.IllegalAccessException
protected java.lang.Object getBeanProperty(java.lang.Object target, java.lang.String name, java.lang.Class stopClass) throws java.lang.IllegalAccessException
getBeanProperty
in class Runtime
target
- the target beanname
- the Bean property namestopClass
- the Introspector's "stopClass"java.lang.IllegalAccessException
public void setBeanProperty(java.lang.Object target, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
setBeanProperty
in class Runtime
target
- the target beanname
- the Bean property namevalue
- the new property valuejava.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
protected void setBeanProperty(java.lang.Object target, java.lang.String name, java.lang.Object value, java.lang.Class stopClass) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
setBeanProperty
in class Runtime
target
- the target beanname
- the Bean property namevalue
- the new property valuestopClass
- the Introspector's "stopClass"java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.lang.Class getBeanPropertyType(java.lang.Class cls, java.lang.String name)
getBeanPropertyType
in class Runtime
cls
- the class of the beanname
- the property name of the bean property