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

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.XMLNamespaceDeclaration
                  extended by org.inria.ns.reflex.processor.xcl.xml.XMLAttribute
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory

public class XMLAttribute
extends XMLNamespaceDeclaration

<xcl:attribute> is an action that creates an XML attribute used to feed the XML context. The unmarshaller may return either a SetXMLAttribute or an instance of this class.

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
XMLAttribute(QExpression name, Expression value, boolean normalize, Node node, AbstractAction parent)
          Creates a new instance of XMLAttribute.
 
Method Summary
 Attr getAttribute(DataSet dataSet)
          Computes the XML attribute represented by this action.
 Object getData(DataSet dataSet)
          Return the XML attribute that will feed the context.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for XMLAttribute or SetXMLAttribute.
 
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

XMLAttribute

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

Parameters:
name - The qualified name of the attribute, as a QExpression.
value - The value of the attribute, 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 XMLAttribute or SetXMLAttribute.

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

getData

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

Overrides:
getData in class XMLNamespaceDeclaration
Parameters:
dataSet - The set of datas used when the attribute is computed.
Returns:
The computed XML attribute Attr
Throws:
ExecutionException - If the computation can't be performed.
XPathException - If one of the expressions encountered are invalid.

getAttribute

public Attr getAttribute(DataSet dataSet)
                  throws XPathException,
                         ExecutionException
Computes the XML attribute represented by this action.

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