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

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.XMLText
All Implemented Interfaces:
XMLWhitespaceKeeper, Executable, Presentable, NamespaceContextFactory

public class XMLText
extends XMLAction
implements XMLWhitespaceKeeper

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

Author:
Philippe Poulard
See Also:
LiteralTextAction

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
XMLText(Expression text, boolean isCDataSection, Node node, AbstractAction parent)
          Creates a new instance of XMLText.
 
Method Summary
 Object getData(DataSet dataSet)
          Return the XML text that will feed the context.
 Text getText(DataSet dataSet)
          Computes the XML text represented by this action.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for XMLText.
 
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

XMLText

public XMLText(Expression text,
               boolean isCDataSection,
               Node node,
               AbstractAction parent)
Creates a new instance of XMLText.

Parameters:
text - The text, as an Expression.
isCDataSection - Indicates if the text to create will be a CDATA section or not.
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 XMLText.

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

getData

public Object getData(DataSet dataSet)
               throws XPathException,
                      ExecutionException
Return the XML text that will feed the context.

Specified by:
getData in class AbstractFeedAction
Parameters:
dataSet - The set of datas used when the text is computed.
Returns:
The computed XML text Text
Throws:
ExecutionException - If the computation can't be performed.
XPathException - If one of the expressions encountered are invalid.

getText

public Text getText(DataSet dataSet)
             throws XPathException,
                    ExecutionException
Computes the XML text represented by this action.

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