bsh
public class This extends Object implements Serializable, Runnable
Constructor Summary | |
---|---|
protected | This(NameSpace namespace, Interpreter declaringInterpreter) |
Method Summary | |
---|---|
static void | bind(This ths, NameSpace namespace, Interpreter declaringInterpreter)
Bind a This reference to a parent's namespace with the specified
declaring interpreter. |
Object | getInterface(Class clas)
Get a version of this scripted object implementing the specified
interface. |
Object | getInterface(Class[] ca)
Get a version of this scripted object implementing the specified
interfaces. |
NameSpace | getNameSpace() |
Object | invokeMethod(String name, Object[] args)
Invoke specified method as from outside java code, using the
declaring interpreter and current namespace.
|
Object | invokeMethod(String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo)
Invoke a method in this namespace with the specified args,
interpreter reference, callstack, and caller info.
|
void | run() |
String | toString() |
This is a static utility method because it's used by a bsh command bind() and the interpreter doesn't currently allow access to direct methods of This objects (small hack)
See Also: Primitive
Note: If you use this method outside of the bsh package and wish to use variables with primitive values you will have to wrap them using bsh.Primitive. Consider using This getInterface() to make a true Java interface for invoking your scripted methods.
This method also implements the default object protocol of toString(), hashCode() and equals() and the invoke() meta-method handling as a last resort.
Note: the invoke() method will not catch the object method (toString, ...). If you want to override them you have to script them directly.
Parameters: if callStack is null a new CallStack will be created and initialized with this namespace.
See Also: bsh.This.invokeMethod(
String methodName, Object [] args, Interpreter interpreter,
CallStack callstack, SimpleNode callerInfo )
Primitive