org.apache.commons.scxml
Interface Evaluator

All Known Implementing Classes:
ELEvaluator, JexlEvaluator

public interface Evaluator

Interface for a component that may be used by the SCXML engines to evaluate the expressions within the SCXML document.


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.
 Context newContext(Context parent)
          Create a new child context.
 

Method Detail

eval

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

Parameters:
ctx - variable context
expr - expression
Returns:
a result of the evaluation
Throws:
SCXMLExpressionException - A malformed exception

evalCond

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

Parameters:
ctx - variable context
expr - expression
Returns:
true/false
Throws:
SCXMLExpressionException - A malformed exception

evalLocation

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

Parameters:
ctx - variable context
expr - expression
Returns:
The location node.
Throws:
SCXMLExpressionException - A malformed exception

newContext

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

Parameters:
parent - parent context
Returns:
new child context


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