|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.storm.DynamicObject
Object should extends from this class if it can be exposed to a scripter. In general methods with word Dynamic are to access a fixed number of methods and fields known at compile time and Slot variants are responsible for more flexible structures. If accessing named property, scripter should first call Dynamic method, then imploy reflection if necessary and then call Slot method if field/method was not found. All methods with `DynEnv env' argument should use it to warp/unwrap script objects to a particular type.
| Field Summary | |
static Object |
NOT_FOUND
Indicates that dynamic value was does not present |
static int |
SETD_IGNORE
Return values for setDynamicValue |
static int |
SETD_NOT_FOUND
Return values for setDynamicValue |
static int |
SETD_OK
Return values for setDynamicValue |
| Constructor Summary | |
DynamicObject()
|
|
| Method Summary | |
void |
deleteSlot(int index)
|
void |
deleteSlot(String name)
|
Object |
execDynamicMethod(String name,
Object[] args,
DynEnv env)
Perform function-like actions for `name' with the given args. |
Object |
getDynamicScopeParent()
This is only relevant to support scope chain during event handler execution. |
Object |
getDynamicValue(String name,
DynEnv env)
Returns the `key' field or Defs.NOT_FOUND if `name' does not exist. |
Object[] |
getEnumeratableIds(DynEnv env,
int add_head_allocation)
|
DynamicObject |
getMethodPropertySource(String methodName,
DynEnv env)
ALERT: this is some-what weired method but it helps to merge same named properties and methods |
protected Object |
getScriptDataLock()
Return lock object to get exclusive access for scripta data or null if no synchronization should be used |
Object |
getScriptWrapper(Object key)
|
Object |
getSlot(int index,
DynEnv env)
|
Object |
getSlot(String name,
DynEnv env)
|
boolean |
hasSlot(int index,
DynEnv env)
|
boolean |
hasSlot(String name,
DynEnv env)
|
Object |
javaReflectionTarget()
Returns null if Java reflection should not be used for this object. |
boolean |
readOnlySlots()
Returns true if access to object via Slot-type methods are read-only |
protected Object |
script_toSource(DynEnv env)
Overwrite if notion of `source' can be implemented in a resonable way. |
String |
script_toString(DynEnv env)
Overwrite if Java toString() is not good enough for script Invoked via execDynamicMethod("toString", ...) |
int |
setDynamicValue(String name,
Object value,
DynEnv env)
Set field `name' to `value'. |
Object |
setScriptWrapperIfAbsent(Object key,
Object value)
|
void |
setSlot(int index,
Object value,
DynEnv env)
Set index slot to `value'. |
void |
setSlot(String name,
Object value,
DynEnv env)
Set named slot to `value'. |
void |
unlinkAllSlots()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Object NOT_FOUND
public static final int SETD_NOT_FOUND
public static final int SETD_OK
public static final int SETD_IGNORE
| Constructor Detail |
public DynamicObject()
| Method Detail |
protected Object getScriptDataLock()
public Object javaReflectionTarget()
public boolean readOnlySlots()
public Object getDynamicValue(String name,
DynEnv env)
public int setDynamicValue(String name,
Object value,
DynEnv env)
public Object execDynamicMethod(String name,
Object[] args,
DynEnv env)
DynEnv
public DynamicObject getMethodPropertySource(String methodName,
DynEnv env)
public Object getDynamicScopeParent()
protected Object script_toSource(DynEnv env)
public String script_toString(DynEnv env)
public boolean hasSlot(String name,
DynEnv env)
public boolean hasSlot(int index,
DynEnv env)
public Object getSlot(String name,
DynEnv env)
public Object getSlot(int index,
DynEnv env)
public void setSlot(String name,
Object value,
DynEnv env)
public void setSlot(int index,
Object value,
DynEnv env)
public void deleteSlot(String name)
public void deleteSlot(int index)
public Object setScriptWrapperIfAbsent(Object key,
Object value)
public Object getScriptWrapper(Object key)
public void unlinkAllSlots()
public Object[] getEnumeratableIds(DynEnv env,
int add_head_allocation)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||