|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface used for interfacing the FESI EcmaScript interpreter with Java code. Based and largely compatible with the Netscape JavaScript to Java interface.
This interface is exported by FESI objects, it is not intended or useful for user objects to extend this interface.
Non function objects need not implement any specific interface, FESI using introspection to discover their properties. Function objects must implement JSFunction.
Method Summary | |
---|---|
java.lang.Object |
call(java.lang.String methodName,
java.lang.Object[] args)
Call the specified EcmaScript method of this object |
java.lang.Object |
eval(java.io.Reader r,
java.lang.String d)
Evaluate a Reader stream with this object as the 'this' object. |
java.lang.Object |
eval(java.lang.String s)
Evaluate a string with this object as the 'this' object. |
java.lang.Object |
evalAsFunction(java.lang.String s)
Evaluate a string with this object as the 'this' object. |
java.lang.Object |
evalAsFunction(java.lang.String s,
java.lang.String[] names,
java.lang.Object[] values)
Evaluate a string with this object as the 'this' object. |
JSGlobalObject |
getGlobalObject()
Get the global object of the interpreter |
java.lang.Object |
getMember(java.lang.String name)
Get the named property of this object. |
java.lang.Object |
getSlot(int index)
Get the indexed property of this object (useful for arrays). |
void |
removeMember(java.lang.String name)
Delete a named property of this object |
void |
setMember(java.lang.String name,
java.lang.Object value)
Set the value of a named property of this object |
void |
setSlot(int index,
java.lang.Object value)
Set a property by index value. |
Method Detail |
public java.lang.Object call(java.lang.String methodName, java.lang.Object[] args) throws JSException
methodName
- The name of the method to callargs
- An array of parameters.
JSException
- For any error during interpretationpublic java.lang.Object eval(java.lang.String s) throws JSException
s
- The string to evaluate
JSException
- For any error during interpretationpublic java.lang.Object eval(java.io.Reader r, java.lang.String d) throws JSException
r
- The Reader stream to evaluated
- A description of the Reader for error messages
JSException
- For any error during interpretationpublic java.lang.Object evalAsFunction(java.lang.String s) throws JSException
s
- The string to evaluate
JSException
- For any error during interpretationpublic java.lang.Object evalAsFunction(java.lang.String s, java.lang.String[] names, java.lang.Object[] values) throws JSException
s
- The string to evaluatenames
- the names of the parametersvalues
- the values of the parameters
JSException
- For any error during interpretationpublic java.lang.Object getMember(java.lang.String name) throws JSException
name
- The name of the property to get
JSException
- For any error during interpretationpublic java.lang.Object getSlot(int index) throws JSException
index
- The index value of the property (converted
to string if not an array)
JSException
- For any error during interpretationpublic void removeMember(java.lang.String name) throws JSException
name
- The name of the property to delete
JSException
- For any error during interpretationpublic void setMember(java.lang.String name, java.lang.Object value) throws JSException
name
- The name of the property to setvalue
- The value to set the property to.
JSException
- For any error during interpretationpublic void setSlot(int index, java.lang.Object value) throws JSException
index
- The index of the property in the array.value
- The value to set the property to.
JSException
- For any error during interpretationpublic JSGlobalObject getGlobalObject()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |