类 This
- 所有已实现的接口:
Serializable
,Runnable
- 直接已知子类:
XThis
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static void
bind
(This ths, NameSpace namespace, Interpreter declaringInterpreter) Bind a This reference to a parent's namespace with the specified declaring interpreter.getInterface
(Class clas) Get a version of this scripted object implementing the specified interface.getInterface
(Class[] ca) Get a version of this scripted object implementing the specified interfaces.invokeMethod
(String name, Object[] args) Invoke specified method as from outside java code, using the declaring interpreter and current namespace.invokeMethod
(String methodName, Object[] args, Interpreter interpreter, CallStack callstack, bsh.SimpleNode callerInfo, boolean declaredOnly) Invoke a method in this namespace with the specified args, interpreter reference, callstack, and caller info.void
run()
toString()
-
构造器详细资料
-
This
-
-
方法详细资料
-
getInterface
Get a version of this scripted object implementing the specified interface.- 抛出:
UtilEvalError
-
getInterface
Get a version of this scripted object implementing the specified interfaces.- 抛出:
UtilEvalError
-
getNameSpace
-
toString
-
run
public void run() -
invokeMethod
Invoke specified method as from outside java code, using the declaring interpreter and current namespace. The call stack will indicate that the method is being invoked from outside of bsh in native java code. Note: you must still wrap/unwrap args/return values using Primitive/Primitive.unwrap() for use outside of BeanShell. -
invokeMethod
public Object invokeMethod(String methodName, Object[] args, Interpreter interpreter, CallStack callstack, bsh.SimpleNode callerInfo, boolean declaredOnly) throws EvalError Invoke a method in this namespace with the specified args, interpreter reference, callstack, and caller info.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() meta-method will not catch the Object protocol methods (toString(), hashCode()...). If you want to override them you have to script them directly.
-
bind
Bind a This reference to a parent's namespace with the specified declaring interpreter. Also re-init the callstack. It's necessary to bind a This reference before it can be used after deserialization. This is used by the bsh load() command.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)
-