Google

: Interface JSFunction

FESI.jslib
Interface JSFunction

All Known Implementing Classes:
JSFunctionAdapter

public abstract interface JSFunction

Interface that an object must implement to be considered an EcmaScript function.

This interface may be implemented by an object which will then be recognized as a function or a constructor if used in EcmaScript.

Non function objects need not implement any specific interface, FESI using introspection to discover their properties.

The parameters passed to the doCall or doNew arguments are transformed as follow:
If they are FESI objects they are wrapped as JSObjects.
If they are FESI primitive, the corresponding most primitive java object is used (for example Integer).
Otherwise (native objects) they are passed as native objects.

See Also:
JSFunctionAdapter

Method Summary
 java.lang.Object doCall(JSObject thisObject, java.lang.Object[] args)
          Call the specified EcmaScript method of this object
 java.lang.Object doNew(JSObject thisObject, java.lang.Object[] args)
          Create a new object, using the specified EcmaScript method of this object
 

Method Detail

doCall


public java.lang.Object doCall(JSObject thisObject,
                               java.lang.Object[] args)
                        throws JSException
Call the specified EcmaScript method of this object
Parameters:
thisObject - The object for which the function is called.
args - An array of parameters.
Returns:
The result of the evaluation
Throws:
JSException - For any error during interpretation

doNew


public java.lang.Object doNew(JSObject thisObject,
                              java.lang.Object[] args)
                       throws JSException
Create a new object, using the specified EcmaScript method of this object
Parameters:
thisObject - The object for which the function is called.
args - An array of parameters.
Returns:
The result of the evaluation
Throws:
JSException - For any error during interpretation