This project has retired. For details please refer to its
Attic page .
NamedPatternsSelector (Cocoon Sitemap Implementation 1.0.0 API)
org.apache.cocoon.selection
Class NamedPatternsSelector
java.lang.Object
org.apache.cocoon.util.AbstractLogEnabled
org.apache.cocoon.selection.NamedPatternsSelector
All Implemented Interfaces: Configurable , org.apache.cocoon.selection.Selector, ThreadSafe
public abstract class NamedPatternsSelector extends org.apache.cocoon.util.AbstractLogEnabledimplements Configurable , ThreadSafe , org.apache.cocoon.selection.Selector
Abstract class for selectors that select a value when it matches
some patterns associated to the select expression.
Known implementations of this abstract class include BrowserSelector,
HostSelector from cocoon-sitemap-components maven module.
Version:
$Id: NamedPatternsSelector.html 1304280 2012-03-23 11:18:01Z ilgrosso $
Fields inherited from interface org.apache.cocoon.selection.Selector
ROLE
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Methods inherited from interface org.apache.cocoon.selection.Selector
select
NamedPatternsSelector
public NamedPatternsSelector ()
configure
protected void configure (Configuration conf,
String confName,
String nameAttr,
String valueAttr)
throws ConfigurationException
Setup the association from expressions to a list of patterns. The configuration
should look like :
<pre>
<map:selector name="foo" src="...">
<confName nameAttr="expression" valueAttr="pattern"/>
... others (expression, pattern) associations ...
</map:selector>
</pre>
Parameters: conf - the configurationconfName - the name of children of conf that will be used to
build associationsnameAttr - the name of the attribute that holds the expressionvalueAttr - the name of the attribute that holds the pattern
Throws:
ConfigurationException
checkPatterns
protected boolean checkPatterns (String expression,
String value)
Checks if value is a substring of one of the patterns associated
to expression
Parameters: expression - the expression that is selectedvalue - the value to check
Returns: true if value matches one of the patterns
Copyright © 1999-2008 The Apache Software Foundation . All Rights Reserved.