org.apache.cocoon.selection
Class SimpleSelector
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.selection.AbstractSwitchSelector
org.apache.cocoon.selection.SimpleSelector
- All Implemented Interfaces:
- Component, LogEnabled, Selector, SwitchSelector, ThreadSafe
- public class SimpleSelector
- extends AbstractSwitchSelector
A very simple selector that operates on string literals, useful especially
in conjunction with input modules. Usage example:
<map:selector name="simple" src="org.apache.cocoon.selection.SimpleSelector"/>
<map:select type="simple">
<map:parameter name="value" value="{request:method}"/>
<map:when test="GET">
...
</map:when>
<map:when test="POST">
...
</map:when>
<map:when test="PUT">
...
</map:when>
<map:otherwise>
...
</map:otherwise>
</map:select>
- Since:
- 2.1
- Version:
- CVS $Id: SimpleSelector.java 433543 2006-08-22 06:22:54Z crossley $
- Author:
- Christian Haul
|
Method Summary |
Object |
getSelectorContext(Map objectModel,
Parameters parameters)
Method to create a selector context. |
boolean |
select(String expression,
Object selectorContext)
Switch Selectors test patterns against a context object
and signal success with the returned boolean value |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleSelector
public SimpleSelector()
getSelectorContext
public Object getSelectorContext(Map objectModel,
Parameters parameters)
- Description copied from interface:
SwitchSelector
- Method to create a selector context.
- Parameters:
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:
- Selector context
select
public boolean select(String expression,
Object selectorContext)
- Description copied from interface:
SwitchSelector
- Switch Selectors test patterns against a context object
and signal success with the returned boolean value
- Parameters:
expression - The expression to test.selectorContext - The context this test should be performed in.
- Returns:
- true if the test was successful.
Copyright © 1999-2006 The Apache Software Foundation. All Rights Reserved.