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

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

public class XMLProcessingInstruction
extends XMLAction

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

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
XMLProcessingInstruction(QExpression target, Expression data, Node node, AbstractAction parent)
          Creates a new instance of XMLProcessingInstruction.
 
Method Summary
 Object getData(DataSet dataSet)
          Return the XML processing instruction that will feed the context.
 ProcessingInstruction getProcessingInstruction(DataSet dataSet)
          Computes the XML processing instruction represented by this action.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for XMLProcessingInstruction.
 
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

XMLProcessingInstruction

public XMLProcessingInstruction(QExpression target,
                                Expression data,
                                Node node,
                                AbstractAction parent)
Creates a new instance of XMLProcessingInstruction.

Parameters:
target - The target of the PI, as a QExpression, that must be an NCName.
data - The data of the PI, 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 XMLProcessingInstruction.

Parameters:
parent - The action depending from.
element - The XML element to unmarshall.
Returns:
The XMLProcessingInstruction 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 processing instruction that will feed the context.

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

getProcessingInstruction

public ProcessingInstruction getProcessingInstruction(DataSet dataSet)
                                               throws XPathException,
                                                      ExecutionException
Computes the XML processing instruction represented by this action.

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