org.inria.ns.reflex.processor.xcl.xml
Class XMLAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.core.AbstractFeedAction
          extended by org.inria.ns.reflex.processor.xcl.xml.XMLAction
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory
Direct Known Subclasses:
XMLComment, XMLElement, XMLNamespaceDeclaration, XMLProcessingInstruction, XMLText

public abstract class XMLAction
extends AbstractFeedAction

This class is designed to produce XML objects when an XML action is encountered ; an XML object created is used to feed the current context.

An XML object may have a name and a value (or a content), that are computed at runtime. An XML object that has a value (or a content) is usually described with an attribute for this purpose. When this attribute is missing, this value is computed with the subactions. The content -mentionned above- of elements and documents are their children.

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
XMLAction(Node node, AbstractAction parent)
          Creates a new instance of XMLAction with no name and a content given by nested subactions.
XMLAction(QExpression name, Expression value, Node node, AbstractAction parent)
          Creates a new instance of XMLAction.
 
Method Summary
 QName getName(DataSet dataSet)
          Return the name of an XML object : an attribute name, an element name, etc.
 void runAction(DataSet dataSet)
          Execute the action by adding a data to the current context.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractFeedAction
getData
 
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, unmarshal
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLAction

public XMLAction(QExpression name,
                 Expression value,
                 Node node,
                 AbstractAction parent)
Creates a new instance of XMLAction.

Parameters:
name - The name of the XML object, or null for XML objects that have no name. null could also be provided with concrete implementations that override getName(DataSet).
value - The content of the XML object, or null if it is given by nested subactions or is not applicable.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.

XMLAction

public XMLAction(Node node,
                 AbstractAction parent)
Creates a new instance of XMLAction with no name and a content given by nested subactions.

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

getName

public QName getName(DataSet dataSet)
              throws ExecutionException,
                     XPathException
Return the name of an XML object : an attribute name, an element name, etc.

Parameters:
dataSet - The set of datas used when the name is computed.
Returns:
A name, or null.
Throws:
ExecutionException - If the computation can't be performed.
XPathException

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Execute the action by adding a data to the current context.

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