org.apache.cocoon.matching
Interface PreparableMatcher
- All Superinterfaces:
- org.apache.avalon.framework.component.Component, Matcher
- All Known Implementing Classes:
- AbstractPreparableMatcher
- public interface PreparableMatcher
- extends Matcher
A matcher that can prepare patterns during sitemap setup for faster match at request time.
This is also a regular matcher, meaning the sitemap can decide either to prepare the pattern
or to match with a request-time evaluated pattern (for {..} substitution).
- Version:
- CVS $Revision: 1.1.2.2 $ $Date: 2001/11/06 10:13:07 $
- Author:
- Sylvain Wallez
Fields inherited from interface org.apache.cocoon.matching.Matcher |
ROLE |
Method Summary |
java.util.Map |
preparedMatch(java.lang.Object preparedPattern,
java.util.Map objectModel,
org.apache.avalon.framework.parameters.Parameters parameters)
Matches the prepared pattern against some values in the object model (most often the
Request Map object with replacements
for wildcards contained in the pattern. |
java.lang.Object |
preparePattern(java.lang.String pattern)
Prepares a pattern in a form that allows faster match. |
Methods inherited from interface org.apache.cocoon.matching.Matcher |
match |
preparePattern
public java.lang.Object preparePattern(java.lang.String pattern)
throws PatternException
- Prepares a pattern in a form that allows faster match. For example, a regular
expression matcher can precompile the expression and return the corresponding
object. This method is called once for each pattern used with a particular matcher
class. The returned value is then passed back as the
preparedPattern
parameter of preparedMatch(Object, Map, Parameters)
.
- 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.
- Throws:
a
- PatternException
if the pattern couldn't be prepared.
preparedMatch
public java.util.Map preparedMatch(java.lang.Object preparedPattern,
java.util.Map objectModel,
org.apache.avalon.framework.parameters.Parameters parameters)
- Matches the prepared pattern against some values in the object model (most often the
Request
Map object with replacements
for wildcards contained in the pattern.
- Parameters:
preparedPattern
- The preparedPattern to match against, as returned by 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.
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.