Class ParameterSelector

  extended by org.apache.cocoon.selection.ParameterSelector
All Implemented Interfaces:
Component, ThreadSafe, Selector

public class ParameterSelector
extends Object
implements ThreadSafe, Selector

A Selector that matches a string in the parameters object passed to it.

  <map:selector name="parameter" factory="org.apache.cocoon.selection.ParameterSelector"/>

   <map:select type="parameter">
      <map:parameter name="parameter-selector-test" value="{mySitemapParameter}"/>

      <map:when test="myParameterValue">
         <!-- executes iff {mySitemapParameter} == "myParameterValue" -->
         <map:transform src="stylesheets/page/uk.xsl"/>
         <map:transform src="stylesheets/page/us.xsl"/>
The purpose of this selector is to allow an action to set parameters and to be able to select between different pipeline configurations depending on those parameters.

CVS $Id: ParameterSelector.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Leo Sutic, Sylvain Wallez

Field Summary
Fields inherited from interface org.apache.cocoon.selection.Selector
Constructor Summary
Method Summary
 boolean select(String expression, Map objectModel, Parameters parameters)
          Selectors test pattern against some objects in a Map model and signals success with the returned boolean value
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ParameterSelector()
Method Detail


public boolean select(String expression,
                      Map objectModel,
                      Parameters parameters)
Description copied from interface: Selector
Selectors test pattern against some objects in a Map model and signals success with the returned boolean value

Specified by:
select in interface Selector
expression - The expression to test.
objectModel - The Map containing object of the calling environment which may be used to select values to test the expression.
parameters - The sitemap parameters, as specified by <parameter/> tags.
boolean Signals successfull test.

Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.