public abstract class ContextItem
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static ContextItem |
createConstructor(java.lang.String name,
java.lang.Class prototype)
Get a ContextItem that represents a constructor in the scripting
environment.
|
static ContextItem |
createGlobalFunction(java.lang.String name,
GlobalFunction function)
Get a ContextItem that represents a global function in the scripting
environment.
|
static ContextItem |
createItem(java.lang.String name)
Get a ContextItem object with the given name.
|
static ContextItem |
createItem(java.lang.String name,
java.lang.Object contextItem)
Get a ContextItem object with the given name and set to contextItem.
|
java.lang.Object |
getContextObject()
Get a reference to the contextObject.
|
java.lang.String |
getName()
Get the name of the ContextItem.
|
java.lang.String |
getType()
Get the type of the contextObject in the ContextItem.
|
abstract void |
setContextObject(java.lang.Object obj)
Sets the context object (the object to put into the scripting
environment) to obj.
|
public static ContextItem createItem(java.lang.String name)
name - The name for the new ContextItem. The name cannot be changed
later.public static ContextItem createItem(java.lang.String name, java.lang.Object contextItem)
name - The name for the new ContextTime. The name cannot be changed
later.contextItem - The item to set contextObject to.public static ContextItem createConstructor(java.lang.String name, java.lang.Class prototype)
name - The name for the new ContextItem.prototype - The class that acts a prototype for creating new Objects of
the same type. prototype must have a default constructor.public static ContextItem createGlobalFunction(java.lang.String name, GlobalFunction function)
increment();name - The name of the new ContextItem.function - The GlobalFunction object on which to call call()
whenever a script calls the function.public java.lang.Object getContextObject()
public abstract void setContextObject(java.lang.Object obj)
obj - The Object to use as the context object.public java.lang.String getName()
public java.lang.String getType()