org.apache.cocoon.matching
Class AbstractWildcardMatcher
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.matching.AbstractPreparableMatcher
org.apache.cocoon.matching.AbstractWildcardMatcher
- All Implemented Interfaces:
- LogEnabled, Matcher, PreparableMatcher, ThreadSafe
- Direct Known Subclasses:
- CachingWildcardMatcher, WildcardHeaderMatcher, WildcardHostMatcher, WildcardMatcher, WildcardParameterMatcher, WildcardRequestAttributeMatcher, WildcardRequestParameterMatcher, WildcardSessionAttributeMatcher, WildcardURIMatcher
- public abstract class AbstractWildcardMatcher
- extends AbstractPreparableMatcher
- implements ThreadSafe
Base class for wildcard matchers
- Version:
- CVS $Id: AbstractWildcardMatcher.java 30941 2004-07-29 19:56:58Z vgritsenko $
- Author:
- Sylvain Wallez
Fields inherited from interface org.apache.cocoon.matching.Matcher |
ROLE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractWildcardMatcher
public AbstractWildcardMatcher()
preparePattern
public Object preparePattern(String pattern)
- Compile the pattern in an
int[]
.
- Specified by:
preparePattern
in interface PreparableMatcher
- Parameters:
pattern
- The pattern to prepare. Depending on the implementation the pattern
can contain wildcards or regular expressions.
- Returns:
- an optimized representation of the pattern.
preparedMatch
public Map preparedMatch(Object preparedPattern,
Map objectModel,
Parameters parameters)
throws PatternException
- Match the prepared pattern against the result of
getMatchString(Map, Parameters)
.
- Specified by:
preparedMatch
in interface PreparableMatcher
- Parameters:
preparedPattern
- The preparedPattern to match against, as returned by PreparableMatcher.preparePattern(String)
.objectModel
- The Map
with objects of the calling environment
which can be used to select values this matchers matches against.
- Returns:
- a
Map
object with replacements for wildcards/regular-expressions
contained in the pattern. If the return value is null there was no match.
- Throws:
PatternException
getMatchString
protected abstract String getMatchString(Map objectModel,
Parameters parameters)
- Get the string to test against the wildcard expression. To be defined
by concrete subclasses.
Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.