|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.itim.fesiextensions.FESIScriptEvaluator
Script evaluator (interpreter) specialization that interprets javascript using the FESI engine. The interpreter can be initialized with custom extensions and pre-defined script objects to be made available to script authors.
Fields inherited from interface com.ibm.itim.fesiextensions.FESIExtensionConstants |
CUSTOM_ERROR_INVALID_FUNCTION_ARGUMENTS, CUSTOM_ERROR_INVALID_IMPLEMENTATION_CLASS, FESI_EXTENSION_PREFIX_ENROLE, MULTIVALUE_DELIMITER |
Constructor Summary | |
FESIScriptEvaluator(java.util.Collection extensions)
Constructs interpreter with the specified set of extensions. |
|
FESIScriptEvaluator(java.lang.String propertyFile,
java.lang.String extensionPrefix)
Constructs interpreter with a set of extensions defined within the given file. |
Method Summary | |
void |
createScriptObject(java.lang.String name,
java.util.Map properties)
Creates a named object that can be used in the client's script with a collection of properties. |
void |
createScriptObject(java.lang.String name,
java.lang.Object item)
Creates a named object that can be used in the client's script. |
java.lang.Object |
evaluate(java.lang.String scr,
boolean evalAsFunction)
Evaluates the specified script. |
java.lang.Object |
evaluate(java.lang.String scr,
java.util.Map attributes,
boolean evalAsFunction)
Deprecated. use evaluate(String scr, boolean evalAsFunction) |
java.lang.Object |
evaluate(java.lang.String scr,
java.lang.Object[] data,
boolean evalAsFunction)
Deprecated. Use evaluate(String scr, boolean evalAsFunction) |
JSGlobalObject |
getGlobalObject()
Returns the javascript global object for the interpreter. |
void |
setContextItem(java.lang.String name,
java.lang.Object item)
Deprecated. Use createScriptObject(String name, Object item). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FESIScriptEvaluator(java.lang.String propertyFile, java.lang.String extensionPrefix) throws ScriptEvaluatorException
propertyFile
- Name of the property file that contains the names of the
extension classes to load.extensionPrefix
- Prefix of the context keyword used to identify the
correct extensions to load.ScriptEvaluatorException
- Thrown if unable to create the interpreter,
most likely due to an error initializing the specified extensions.public FESIScriptEvaluator(java.util.Collection extensions) throws ScriptEvaluatorException
extensions
- Collection of extension full class names.ScriptEvaluatorException
- Thrown if unable to create the interpreter,
most likely due to an error initializing the specified extensions.Method Detail |
public java.lang.Object evaluate(java.lang.String scr, java.lang.Object[] data, boolean evalAsFunction) throws ScriptEvaluatorException
evaluate
in interface ScriptEvaluatorInterface
scr
- Script to evaluate.data
- Object array of runtime context data.evalAsFunction
- either true for full function support or false for simple expressions
not requiring a return statement.ScriptEvaluatorException
- Thrown if error(s) encountered during evaluation.public java.lang.Object evaluate(java.lang.String scr, java.util.Map attributes, boolean evalAsFunction) throws ScriptEvaluatorException
evaluate
in interface ScriptEvaluatorInterface
scr
- Script to evaluate.data
- Map of runtime context data, where the key is the variable name and the value is
the variable value.evalAsFunction
- either true for full function support or false for simple expressions
not requiring a return statement.ScriptEvaluatorException
- Thrown if error(s) encountered during evaluation.public java.lang.Object evaluate(java.lang.String scr, boolean evalAsFunction) throws ScriptEvaluatorException
evaluate
in interface ScriptEvaluatorInterface
scr
- Script to evaluate.evalAsFunction
- either true for full function support or false for simple expressions
not requiring a return statement.ScriptEvaluatorException
- Thrown if error(s) encountered during evaluation.public void setContextItem(java.lang.String name, java.lang.Object item) throws ScriptEvaluatorException
setContextItem
in interface ScriptEvaluatorInterface
name
- Name of the variable.item
- Object holding the variable's data.ScriptEvaluatorException
- Thrown if unable to create the variable.public JSGlobalObject getGlobalObject()
public void createScriptObject(java.lang.String name, java.lang.Object item) throws ScriptEvaluatorException
createScriptObject
in interface ScriptEvaluatorInterface
name
- name of the object in the scripting environmentitem
- Object that will be made available as a script objectScriptEvaluatorException
- when the object can not be converted
into a format that can be used within the script environmentpublic void createScriptObject(java.lang.String name, java.util.Map properties) throws ScriptEvaluatorException
createScriptObject
in interface ScriptEvaluatorInterface
name
- name of the object in the scripting environmentproperties
- Collection of objects to be used as the created object's
properties.ScriptEvaluatorException
- when the object can not be converted
into a format that can be used within the script environment
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |