org.inria.ns.reflex.processor.xcl
Class LoopAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.xcl.LoopAction
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory

public class LoopAction
extends AbstractAction

At runtime, the <xcl:loop> element repeat the execution of dependant actions while the expression given by the test attribute is true.

<xcl:loop test="{expression}">
     <!-- do something -->
 </xcl:loop>

The expression is evaluated before each loop.

Author:
Philippe Poulard
See Also:
BreakAction, ContinueAction

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
LoopAction(Expression test, Node node, AbstractAction parent)
          Creates a new instance of LoopAction.
 
Method Summary
 void runAction(DataSet dataSet)
          Execute the action by evaluating the test and executing the dependent actions if the test is true.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for LoopAction.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoopAction

public LoopAction(Expression test,
                  Node node,
                  AbstractAction parent)
Creates a new instance of LoopAction.

Parameters:
test - The test to evaluate at each loop.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException,
                                       XPathException
XML unmarshaller for LoopAction.

Parameters:
parent - The action depending from.
element - The XML element to unmarshall.
Returns:
The LoopAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException
XPathException

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Execute the action by evaluating the test and executing the dependent actions if the test is true.

Overrides:
runAction in class AbstractAction
Parameters:
dataSet - The set of datas used when the action is running.
Throws:
ExecutionException - If the action can't be performed.
XPathException