org.inria.ns.reflex.processor.core
Class AbstractAction.ParameterAdapter

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction.ParameterAdapter
Enclosing class:
AbstractAction

public abstract class AbstractAction.ParameterAdapter
extends Object

A class used to find the parameters set when performing subactions, and use them on behalf of any component. An action that may take parameters uses <xcl:param> to set a value to a key. With XCL, parameters, attributes, options, or anything else that consists of a couple of key-value is a parameter set thanks to <xcl:param>. A component that uses parameters, attributes, options, or anything else according to its terminology could use <xcl:param> for this purpose. Concretely, all Map.Entry stored in the context stands as a parameter.

See Also:
Map.Entry

Constructor Summary
AbstractAction.ParameterAdapter()
           
 
Method Summary
 void lookupParameters(DataSet dataSet)
          This default implementation run the actions of the underlying action.
 Object preProcessKey(Object key)
          Perform some process on the key before assigning the key-value to the component.
 Object preProcessValue(Object value)
          Perform some process on the value before assigning the key-value to the component.
abstract  void setParameter(Object key, Object value)
          Assigns a parameter to the component.
 void setParameters(DataSet dataSet)
          Perform parameters lookup on subactions and assign each parameter found on behalf of the component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAction.ParameterAdapter

public AbstractAction.ParameterAdapter()
Method Detail

setParameter

public abstract void setParameter(Object key,
                                  Object value)
                           throws ExecutionException
Assigns a parameter to the component. Concretely, it may be anything that stands as a parameter for the component : a parameter, an attribute, an option... A concrete implementation of this method should know what to do with the key-value. It should behalf on the component that corresponds to the underlying action that uses this ParameterAdapter.

Parameters:
key - The key of the parameter to set.
value - The value of the parameter.
Throws:
ExecutionException - If the parameter can't be set.

setParameters

public void setParameters(DataSet dataSet)
                   throws ExecutionException,
                          XPathException
Perform parameters lookup on subactions and assign each parameter found on behalf of the component. The following default pre-process is performing for the values :

The preProcessValuemethod should be overriden if another behaviour is expected.

Parameters:
dataSet - The set of datas used at runtime.
Throws:
ExecutionException - If a parameter can't be set.
XPathException
See Also:

lookupParameters

public void lookupParameters(DataSet dataSet)
                      throws XPathException,
                             ExecutionException
This default implementation run the actions of the underlying action. It is called by setParameters(DataSet)

Throws:
ExecutionException - When an error occurs.
XPathException - When an error occurs.
See Also:
AbstractAction.runActions(DataSet)

preProcessKey

public Object preProcessKey(Object key)
Perform some process on the key before assigning the key-value to the component. By default, does nothing.

This method should be overriden if a specific behaviour is expected.

Parameters:
key - The key before.
Returns:
The key after.

preProcessValue

public Object preProcessValue(Object value)
Perform some process on the value before assigning the key-value to the component. The following default pre-processing for values is performing :

This method should be overriden if another behaviour is expected.

Parameters:
value - The value before.
Returns:
The value after. If the return value is AbstractSetAction.NO_VALUE, the key-value won't be assigned to the component.