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

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

public class RenameAction
extends AbstractAction

At runtime, the <io:rename> element, renames the file or the directory specified by the source attribute, to the name specified by the new-name attribute.

 <io:rename source="{ expression }" new-name="newFileName"
 xmlns:io="http://ns.inria.org/active-tags/io"/>
 

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

RenameAction

public RenameAction(Expression source,
                    Expression newName,
                    Node node,
                    AbstractAction parent)
Creates a new instance of RenameAction.

Parameters:
source - The file to rename.
newName - The new name to give to the file.
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 RenameAction.

Parameters:
parent - The action depending from.
e - The XML element to unmarshall.
Returns:
The RenameAction 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 renaming the file.

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