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

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
              extended by org.inria.ns.reflex.processor.xcl.xml.XMLElement
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory
Direct Known Subclasses:
LiteralElementAction

public class XMLElement
extends XMLAction

<xcl:element> is an action that creates an XML element used to feed the XML context.

Author:
Philippe Poulard
See Also:
LiteralElementAction

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
XMLElement(QExpression name, Expression content, Node node, AbstractAction parent)
          Creates a new instance of XMLElement.
 
Method Summary
 Object getData(DataSet dataSet)
          Return the XML element (without its content) that will feed the context.
 Element getElement(DataSet dataSet)
          Computes the XML element represented by this action.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for XMLElement.
 
Methods inherited from class org.inria.ns.reflex.processor.xcl.xml.XMLAction
getName, runAction
 
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

XMLElement

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

Parameters:
name - The qualified name of the element, as a QExpression.
content - The content of the element, as an Expression, or null if it is given by nested subactions.
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 UnmarshalException
XML unmarshaller for XMLElement.

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

getData

public Object getData(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Return the XML element (without its content) that will feed the context.

Specified by:
getData in class AbstractFeedAction
Parameters:
dataSet - The set of datas used when the element is computed.
Returns:
The computed XML element Element
Throws:
ExecutionException - If the computation can't be performed.
XPathException - If one of the expressions encountered are invalid.
See Also:
AbstractFeedAction.getData(org.inria.ns.reflex.processor.DataSet)

getElement

public Element getElement(DataSet dataSet)
                   throws XPathException,
                          ExecutionException
Computes the XML element represented by this action. The element created is empty (no content).

Parameters:
dataSet - The set of datas used when the element is computed.
Returns:
The computed XML element.
Throws:
ExecutionException - If the computation can't be performed.
XPathException - If one of the expressions encountered are invalid.