org.apache.commons.scxml.env.jsp
Class ELEvaluator

java.lang.Object
  extended by org.apache.commons.scxml.env.jsp.ELEvaluator
All Implemented Interfaces:
Serializable, Evaluator

public class ELEvaluator
extends Object
implements Evaluator, Serializable

Evaluator implementation enabling use of EL expressions in SCXML documents.

See Also:
Serialized Form

Constructor Summary
ELEvaluator()
          Constructor.
ELEvaluator(javax.servlet.jsp.el.FunctionMapper fnMapper)
          Constructor for EL evaluator that supports user-defined functions.
 
Method Summary
 Object eval(Context ctx, String expr)
          Evaluate an expression.
 Boolean evalCond(Context ctx, String expr)
          Evaluate a condition.
 Node evalLocation(Context ctx, String expr)
          Evaluate a location that returns a Node within an XML data tree.
protected  javax.servlet.jsp.el.FunctionMapper getBuiltinFnMapper()
          Get the FunctionMapper for builtin SCXML/Commons SCXML functions.
protected  org.apache.commons.logging.Log getLog()
          Get the log used by this Evaluator instance.
 Context newContext(Context parent)
          Create a new child context.
protected  void setLog(org.apache.commons.logging.Log log)
          Set the log used by this Evaluator instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ELEvaluator

public ELEvaluator()
Constructor.


ELEvaluator

public ELEvaluator(javax.servlet.jsp.el.FunctionMapper fnMapper)
Constructor for EL evaluator that supports user-defined functions.

Parameters:
fnMapper - The function mapper for this Evaluator.
See Also:
FunctionMapper
Method Detail

eval

public Object eval(Context ctx,
                   String expr)
            throws SCXMLExpressionException
Evaluate an expression.

Specified by:
eval in interface Evaluator
Parameters:
ctx - variable context
expr - expression
Returns:
a result of the evaluation
Throws:
SCXMLExpressionException - For a malformed expression
See Also:
Evaluator.eval(Context, String)

evalCond

public Boolean evalCond(Context ctx,
                        String expr)
                 throws SCXMLExpressionException
Description copied from interface: Evaluator
Evaluate a condition. Manifests as "cond" attributes of <transition>, <if> and <elseif> elements.

Specified by:
evalCond in interface Evaluator
Parameters:
ctx - variable context
expr - expression
Returns:
true/false
Throws:
SCXMLExpressionException - A malformed exception
See Also:
Evaluator.evalCond(Context, String)

evalLocation

public Node evalLocation(Context ctx,
                         String expr)
                  throws SCXMLExpressionException
Description copied from interface: Evaluator
Evaluate a location that returns a Node within an XML data tree. Manifests as "location" attributes of <assign> element.

Specified by:
evalLocation in interface Evaluator
Parameters:
ctx - variable context
expr - expression
Returns:
The location node.
Throws:
SCXMLExpressionException - A malformed exception
See Also:
Evaluator.evalLocation(Context, String)

newContext

public Context newContext(Context parent)
Create a new child context.

Specified by:
newContext in interface Evaluator
Parameters:
parent - parent context
Returns:
new child context
See Also:
Evaluator.newContext(Context)

setLog

protected void setLog(org.apache.commons.logging.Log log)
Set the log used by this Evaluator instance.

Parameters:
log - The new log.

getLog

protected org.apache.commons.logging.Log getLog()
Get the log used by this Evaluator instance.

Returns:
Log The log being used.

getBuiltinFnMapper

protected javax.servlet.jsp.el.FunctionMapper getBuiltinFnMapper()
Get the FunctionMapper for builtin SCXML/Commons SCXML functions.

Returns:
builtinFnMapper The FunctionMapper


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.