|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Invocable
Optional interface implemented by ScriptEngine
s which
allow the invocation of procedures in scripts that have previously
been executed.
See Javadoc of Java Scripting API
Method Summary | |
---|---|
Object |
getInterface(Class clasz)
Retrieves an instance of a java class whose methods are implemented using procedures in script which are in the intermediate code repository in the underlying interpreter. |
Object |
getInterface(Object thiz,
Class clasz)
Retrieves an instance of a java class whose methods are implemented using procedures in script which are in the intermediate code repository in the underlying interpreter. |
Object |
invokeFunction(String name,
Object[] args)
Invokes a scripting procedure with the given name using the array of objects as its arguments set. |
Object |
invokeMethod(Object thiz,
String name,
Object[] args)
Invokes a procedure on an object which already defined in the script using the array of objects as its arguments set. |
Method Detail |
---|
Object invokeFunction(String name, Object[] args) throws ScriptException, NoSuchMethodException
name
- name of the scripting procedureargs
- arguments set for the scripting procedure
ScriptException
- if the invocation of the scripting procedure
fails
NoSuchMethodException
- if method with given name or matching
argument types cannot be found
NullPointerException
- if the method name is null.Object invokeMethod(Object thiz, String name, Object[] args) throws ScriptException, NoSuchMethodException
thiz
- object on which the procedure is calledname
- name of the procedure to be invokedargs
- arguments set for the procedure
ScriptException
- if the invocation of the procedure fails
NoSuchMethodException
- if a method with given name or matching
argument types cannot be found
NullPointerException
- if the method name is null.
IllegalArgumentException
- if the specified thiz
is null or the specified Object is does not represent a scripting object.Object getInterface(Class clasz)
clasz
- an interface which the returned class must
implement
IllegalArgumentException
- if the specified Class object is null or is not an interfaceObject getInterface(Object thiz, Class clasz)
thiz
- The scripting object whose member functions are used to implement the methods of the interface.clasz
- The Class object of the interface to return.
IllegalArgumentException
- if the specified Class object is null or is not an interface,
or if the specified Object is null or does not represent a scripting object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |