| org.apache.cocoon.matching.PreparableMatcher
All known Subclasses: org.apache.cocoon.matching.AbstractPreparableMatcher,
PreparableMatcher | public interface PreparableMatcher extends Matcher(Code) | | 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).
author: Sylvain Wallez version: CVS $Id: PreparableMatcher.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
Object | preparePattern(String pattern) Prepares a pattern in a form that allows faster match. | Map | preparedMatch(Object preparedPattern, Map objectModel, Parameters parameters) Matches the prepared pattern against some values in the object model (most often the
Request ) and returns a Map object with replacements
for wildcards contained in the pattern.
Parameters: preparedPattern - The preparedPattern to match against, as returned by PreparableMatcher.preparePattern(String). Parameters: objectModel - The Map with objects of the calling environmentwhich can be used to select values this matchers matches against. |
preparePattern | Object preparePattern(String pattern) throws PatternException(Code) | | 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
PreparableMatcher.preparedMatch(Object,Map,Parameters) .
Parameters: pattern - The pattern to prepare. Depending on the implementation the patterncan contain wildcards or regular expressions. an optimized representation of the pattern. throws: PatternException - if the pattern couldn't be prepared. |
preparedMatch | Map preparedMatch(Object preparedPattern, Map objectModel, Parameters parameters) throws PatternException(Code) | | Matches the prepared pattern against some values in the object model (most often the
Request ) and returns a Map object with replacements
for wildcards contained in the pattern.
Parameters: preparedPattern - The preparedPattern to match against, as returned by PreparableMatcher.preparePattern(String). Parameters: objectModel - The Map with objects of the calling environmentwhich can be used to select values this matchers matches against. a Map object with replacements for wildcards/regular-expressionscontained in the pattern. If the return value is null there was no match. |
|
|