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

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

public class BreakAction
extends AbstractAction

The <xcl:break> element exits from the current iteration (LoopAction or ForEachAction).

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

Author:
Philippe Poulard
See Also:
LoopAction, ForEachAction, ContinueAction, BreakException

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
BreakAction(Node node, AbstractAction parent)
          Creates a new instance of BreakAction.
 
Method Summary
 void runAction(DataSet dataSet)
          Execute the action by launching a BreakException.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for BreakAction.
 
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

BreakAction

public BreakAction(Node node,
                   AbstractAction parent)
Creates a new instance of BreakAction.

Parameters:
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
XML unmarshaller for BreakAction.

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

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException
Execute the action by launching a BreakException.

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.
See Also:
BreakException