com.ibm.itim.fesiextensions
Class FESIScriptEvaluator

java.lang.Object
  extended by com.ibm.itim.fesiextensions.FESIScriptEvaluator
All Implemented Interfaces:
FESIExtensionConstants, ScriptEvaluatorInterface

Deprecated. This class is the heart of the FESI script framework and will no longer be supported or updated as of ITIM 5.0. Use com.ibm.itim.script.ScriptEvaluator instead

public class FESIScriptEvaluator
extends java.lang.Object
implements ScriptEvaluatorInterface, FESIExtensionConstants

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.

See Also:
ScriptEvaluator

Field Summary
static java.lang.String JAVA_OBJECT_CREATION_ERROR
          Deprecated. Constant representing a message key in a property file
static java.lang.String SCRIPT_OBJECT_CREATION_ERROR
          Deprecated. Constant representing a message key in a property file
 
Fields inherited from interface com.ibm.itim.fesiextensions.FESIExtensionConstants
CUSTOM_ERROR_INVALID_FUNCTION_ARGUMENTS, CUSTOM_ERROR_INVALID_IMPLEMENTATION_CLASS, MULTIVALUE_DELIMITER
 
Constructor Summary
FESIScriptEvaluator(java.util.Collection extensions)
          Deprecated. Constructs interpreter with the specified set of extensions.
FESIScriptEvaluator(java.lang.String propertyFile, java.lang.String extensionPrefix)
          Deprecated. Constructs interpreter with a set of extensions defined within the given file.
 
Method Summary
 void createScriptObject(java.lang.String name, java.util.Map properties)
          Deprecated. 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)
          Deprecated. Creates a named object that can be used in the client's script.
 java.lang.Object evaluate(java.lang.String scr, boolean evalAsFunction)
          Deprecated. 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)
 FESI.jslib.JSGlobalObject getGlobalObject()
          Deprecated. 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
 

Field Detail

SCRIPT_OBJECT_CREATION_ERROR

public static final java.lang.String SCRIPT_OBJECT_CREATION_ERROR
Deprecated. 
Constant representing a message key in a property file

See Also:
Constant Field Values

JAVA_OBJECT_CREATION_ERROR

public static final java.lang.String JAVA_OBJECT_CREATION_ERROR
Deprecated. 
Constant representing a message key in a property file

See Also:
Constant Field Values
Constructor Detail

FESIScriptEvaluator

public FESIScriptEvaluator(java.lang.String propertyFile,
                           java.lang.String extensionPrefix)
                    throws ScriptEvaluatorException
Deprecated. 
Constructs interpreter with a set of extensions defined within the given file. Extensions are defined within the file using the standard property format, <key>=<value> where the key is a prefix that indicates the context in which the extension should be loaded, and the value is the full class name of the extension class. The FactoryExtension will be loaded by default.

Parameters:
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.
Throws:
ScriptEvaluatorException - Thrown if unable to create the interpreter, most likely due to an error initializing the specified extensions.

FESIScriptEvaluator

public FESIScriptEvaluator(java.util.Collection extensions)
                    throws ScriptEvaluatorException
Deprecated. 
Constructs interpreter with the specified set of extensions. The FactoryExtension will be loaded by default.

Parameters:
extensions - Collection of extension full class names.
Throws:
ScriptEvaluatorException - Thrown if unable to create the interpreter, most likely due to an error initializing the specified extensions.
Method Detail

evaluate

public java.lang.Object evaluate(java.lang.String scr,
                                 java.lang.Object[] data,
                                 boolean evalAsFunction)
                          throws ScriptEvaluatorException
Deprecated. Use evaluate(String scr, boolean evalAsFunction)

Evaluates the specified script with some pre-defined objects for context.

Specified by:
evaluate in interface ScriptEvaluatorInterface
Parameters:
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.
Returns:
Result of the evaluation. The client must cast returned object if expecting something more specific than an Object.
Throws:
ScriptEvaluatorException - Thrown if error(s) encountered during evaluation.

evaluate

public java.lang.Object evaluate(java.lang.String scr,
                                 java.util.Map attributes,
                                 boolean evalAsFunction)
                          throws ScriptEvaluatorException
Deprecated. use evaluate(String scr, boolean evalAsFunction)

Evaluates the specified script with some pre-defined objects for context.

Specified by:
evaluate in interface ScriptEvaluatorInterface
Parameters:
scr - Script to evaluate.
attributes - 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.
Returns:
Result of the evaluation. The client must cast returned object if expecting something more specific than an Object.
Throws:
ScriptEvaluatorException - Thrown if error(s) encountered during evaluation.

evaluate

public java.lang.Object evaluate(java.lang.String scr,
                                 boolean evalAsFunction)
                          throws ScriptEvaluatorException
Deprecated. 
Evaluates the specified script.

Specified by:
evaluate in interface ScriptEvaluatorInterface
Parameters:
scr - Script to evaluate.
evalAsFunction - either true for full function support or false for simple expressions not requiring a return statement.
Returns:
Result of the evaluation. The client must cast returned object if expecting something more specific than an Object.
Throws:
ScriptEvaluatorException - Thrown if error(s) encountered during evaluation.

setContextItem

public void setContextItem(java.lang.String name,
                           java.lang.Object item)
                    throws ScriptEvaluatorException
Deprecated. Use createScriptObject(String name, Object item).

Creates a named variable to be used as context in the interpreter's environment for use by the script.

Specified by:
setContextItem in interface ScriptEvaluatorInterface
Parameters:
name - Name of the variable.
item - Object holding the variable's data.
Throws:
ScriptEvaluatorException - Thrown if unable to create the variable.

getGlobalObject

public FESI.jslib.JSGlobalObject getGlobalObject()
Deprecated. 
Returns the javascript global object for the interpreter.

Returns:
JSGlobalObject for the interpreter.

createScriptObject

public void createScriptObject(java.lang.String name,
                               java.lang.Object item)
                        throws ScriptEvaluatorException
Deprecated. 
Creates a named object that can be used in the client's script. This method differes from setContextItem in that it will translate the given java object to an object that is compatible with the scripting language implementation and the result can be used in the client scripts, not just by the script engine extensions.

Specified by:
createScriptObject in interface ScriptEvaluatorInterface
Parameters:
name - name of the object in the scripting environment
item - Object that will be made available as a script object
Throws:
ScriptEvaluatorException - when the object can not be converted into a format that can be used within the script environment

createScriptObject

public void createScriptObject(java.lang.String name,
                               java.util.Map properties)
                        throws ScriptEvaluatorException
Deprecated. 
Creates a named object that can be used in the client's script with a collection of properties. This method can be used when the client does not posess a single object that can be translated one-to-one to a script object, but instead posesses a list of objects that is desired to be grouped in to one script object.

Specified by:
createScriptObject in interface ScriptEvaluatorInterface
Parameters:
name - name of the object in the scripting environment
properties - Collection of objects to be used as the created object's properties.
Throws:
ScriptEvaluatorException - when the object can not be converted into a format that can be used within the script environment


IBM Security Identity Manager 6.0.0
© Copyright International Business Machines Corporation 2007, 2012. All rights reserved. US Government Users Restricited Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.