javax.script
Interface Invocable


public interface Invocable

See Javadoc of Java Scripting API


Method Summary
 java.lang.Object getInterface(java.lang.Class clasz)
          Retrieves an instance of java class whose methods are impelemented using procedures in script which are in the intermediate code repository in the underlying interpreter.
 java.lang.Object getInterface(java.lang.Object thiz, java.lang.Class clasz)
           
 java.lang.Object invokeFunction(java.lang.String name, java.lang.Object[] args)
          Invokes a scripting procedure with the given name using the array of objects as its arguments set.
 java.lang.Object invokeMethod(java.lang.Object thiz, java.lang.String name, java.lang.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

invokeFunction

java.lang.Object invokeFunction(java.lang.String name,
                                java.lang.Object[] args)
                                throws ScriptException,
                                       java.lang.NoSuchMethodException
Invokes a scripting procedure with the given name using the array of objects as its arguments set.

Parameters:
name - name of the scripting procedure
args - arguments set for the scripting procedure
Returns:
resultant object after the execution of the procedure
Throws:
ScriptException - if the invocation of the scripting procedure fails
java.lang.NoSuchMethodException - if method with given name or matching argument types cannot be found

invokeMethod

java.lang.Object invokeMethod(java.lang.Object thiz,
                              java.lang.String name,
                              java.lang.Object[] args)
                              throws ScriptException,
                                     java.lang.NoSuchMethodException
Invokes a procedure on an object which already defined in the script using the array of objects as its arguments set.

Parameters:
name - name of the procedure to be invoked
thiz - object on which the procedure is called
args - arguments set for the procedure
Returns:
resultant object after the execution of the procedure
Throws:
ScriptException - if the invocation of the procedure fails
java.lang.NoSuchMethodException - if a method with given name or matching argument types cannot be found

getInterface

java.lang.Object getInterface(java.lang.Class clasz)
Retrieves an instance of java class whose methods are impelemented using procedures in script which are in the intermediate code repository in the underlying interpreter.

Parameters:
clasz - an interface which the returned class must implement
Returns:
an instance of the class which implement the specified interface

getInterface

java.lang.Object getInterface(java.lang.Object thiz,
                              java.lang.Class clasz)


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.