org.apache.cocoon.selection
Class ParameterSelector
java.lang.Object
|
+--org.apache.cocoon.selection.ParameterSelector
- All Implemented Interfaces:
- org.apache.avalon.framework.component.Component, Selector, org.apache.avalon.framework.thread.ThreadSafe
- Direct Known Subclasses:
- ParameterSelectorFactory
- public class ParameterSelector
- extends java.lang.Object
- implements org.apache.avalon.framework.thread.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:when>
<map:otherwise>
<map:transform src="stylesheets/page/us.xsl"/>
</map:otherwise>
</map:select>
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.
- Version:
- CVS $Id: ParameterSelector.java,v 1.4.2.2 2002/06/05 00:58:23 vgritsenko Exp $
- Author:
- Leo Sutic, Sylvain Wallez
Fields inherited from interface org.apache.cocoon.selection.Selector |
ROLE |
Method Summary |
boolean |
select(java.lang.String expression,
java.util.Map objectModel,
org.apache.avalon.framework.parameters.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 |
ParameterSelector
public ParameterSelector()
select
public boolean select(java.lang.String expression,
java.util.Map objectModel,
org.apache.avalon.framework.parameters.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
- Following copied from interface:
org.apache.cocoon.selection.Selector
- Parameters:
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.- Returns:
- boolean Signals successfull test.
Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.