org.inria.ns.reflex.processor.xcl
Class SetParameterAction

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

public abstract class SetParameterAction
extends AbstractAction

The <xcl:param> element adds a parameter to the current parameter context.

A parameter context should be set by a nested action that work with parameters.

Named and unnamed parameters

There are two type of parameters : named parameters and unnamed parameters :

<xcl:param name="{ expression }" value="{ expression }"/>
<xcl:param value="{ expression }"/>

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
SetParameterAction(Expression value, Node node, AbstractAction parent)
          Creates a new instance of SetParameterAction.
 
Method Summary
static SetParameterAction newSetNamedParameterAction(QExpression name, Expression value, Node node, AbstractAction parent)
          Create a new instance of SetParameterAction.
static SetParameterAction newSetUnnamedParameterAction(Expression value, Node node, AbstractAction parent)
          Create a new instance of SetParameterAction.
 void runAction(DataSet dataSet)
          Return the computed value of the property.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for SetParameterAction.
 
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

SetParameterAction

public SetParameterAction(Expression value,
                          Node node,
                          AbstractAction parent)
Creates a new instance of SetParameterAction.

Parameters:
value - The value of the parameter, as an Expression.
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 XMLException
XML unmarshaller for SetParameterAction.

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

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Return the computed value of the property.

Overrides:
runAction in class AbstractAction
Parameters:
dataSet - The set of datas used when the name is computed.
Throws:
ExecutionException - If the computation can't be performed.
XPathException

newSetNamedParameterAction

public static SetParameterAction newSetNamedParameterAction(QExpression name,
                                                            Expression value,
                                                            Node node,
                                                            AbstractAction parent)
Create a new instance of SetParameterAction.

Parameters:
name - The name of the parameter, as a QExpression.
value - The value of the parameter, as an Expression.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Returns:
The SetParameterAction.

newSetUnnamedParameterAction

public static SetParameterAction newSetUnnamedParameterAction(Expression value,
                                                              Node node,
                                                              AbstractAction parent)
Create a new instance of SetParameterAction.

Parameters:
value - The value of the parameter, as an Expression.
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Returns:
The SetParameterAction for retrieving the init parameters of the servlet.