org.inria.ns.reflex.modules.io
Class SaveAction

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

public class SaveAction
extends AbstractAction

At runtime, the <io:save> element, saves the content specified by the content attribute, in the file specified by the file attribute.

 <io:save file="/path/to/MyFile" content="{ expression }"
 xmlns:io="http://ns.inria.org/active-tags/io"/>
 

*** This implementation is not used : the element is defined as a macro. ***

Author:
Philippe Poulard

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
SaveAction(Expression content, Expression file, Node node, AbstractAction parent)
          Creates a new instance of SaveAction.
 
Method Summary
 void runAction(DataSet dataSet)
          Execute the action by saving the content in the file.
static AbstractAction unmarshal(AbstractAction parent, Element e)
          XML unmarshaller for SaveAction.
 
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

SaveAction

public SaveAction(Expression content,
                  Expression file,
                  Node node,
                  AbstractAction parent)
Creates a new instance of SaveAction.

Parameters:
content - The content to put in the file.
source - The name of the file in which write the content.
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 e)
                                throws XMLException
XML unmarshaller for SaveAction.

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

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Execute the action by saving the content in the file.

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