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

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.core.AbstractSetAction
          extended by org.inria.ns.reflex.processor.xcl.xml.XMLDocument
All Implemented Interfaces:
Computable, Executable, Presentable, NamespaceContextFactory

public class XMLDocument
extends AbstractSetAction

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

The property is preset with an empty content inside the dataset : this allows filters to refer to a DOM context as an alternative channel.

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.AbstractSetAction
NO_VALUE
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
XMLDocument(EvaluableExpression iWantYourSAX, Element element, AbstractAction parent)
          Creates a new instance of XMLDocument.
 
Method Summary
 Object getComputedValue(DataSet dataSet)
          Simply return the XML data (document).
 void runAction(DataSet dataSet)
          Execute the action by setting the named property with its value to the data set.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for XMLDocument.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
addProperty, getComputedName, getName, getValue, scope, unmarshalScope
 
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

XMLDocument

public XMLDocument(EvaluableExpression iWantYourSAX,
                   Element element,
                   AbstractAction parent)
            throws XMLException
Creates a new instance of XMLDocument.

Parameters:
iWantYourSAX - Indicates whether the document to create is a SAX or DOM document. It is not related to George's song.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Throws:
XMLException - When an error occurs.
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws UnmarshalException
XML unmarshaller for XMLDocument.

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

getComputedValue

public Object getComputedValue(DataSet dataSet)
                        throws ExecutionException,
                               XPathException
Simply return the XML data (document). Instead of using it to feed the context, it will be used to set a property.

Specified by:
getComputedValue in interface Computable
Specified by:
getComputedValue in class AbstractSetAction
Parameters:
dataSet - The set of datas used when the name is computed.
Returns:
A SAXDocument or a Document.
Throws:
ExecutionException - If the computation can't be performed.
XPathException - If one of the expressions encountered are invalid.
See Also:
AbstractSetAction.getComputedValue(org.inria.ns.reflex.processor.DataSet)

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Execute the action by setting the named property with its value to the data set. The name and the value of the property are computed before adding the property to the data set.

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