org.apache.cocoon.matching
Class AbstractRegexpMatcher

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.matching.AbstractPreparableMatcher
          extended byorg.apache.cocoon.matching.AbstractRegexpMatcher
All Implemented Interfaces:
org.apache.cocoon.matching.Matcher, org.apache.cocoon.matching.PreparableMatcher, ThreadSafe

public abstract class AbstractRegexpMatcher
extends AbstractPreparableMatcher
implements ThreadSafe

Base class for all matchers using a regular expression pattern.

Version:
$Id: AbstractRegexpMatcher.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from interface org.apache.cocoon.matching.Matcher
ROLE
 
Constructor Summary
AbstractRegexpMatcher()
           
 
Method Summary
protected abstract  String getMatchString(Map objectModel, Parameters parameters)
          Get the string to test against the regular expression.
 Map preparedMatch(Object preparedPattern, Map objectModel, Parameters parameters)
          Match the prepared pattern against the value returned by getMatchString(Map, Parameters).
 Object preparePattern(String pattern)
          Compile the pattern in a org.apache.regexp.REProgram.
 
Methods inherited from class org.apache.cocoon.matching.AbstractPreparableMatcher
match
 
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
 

Constructor Detail

AbstractRegexpMatcher

public AbstractRegexpMatcher()
Method Detail

preparePattern

public Object preparePattern(String pattern)
                      throws org.apache.cocoon.sitemap.PatternException
Compile the pattern in a org.apache.regexp.REProgram.

Specified by:
preparePattern in interface org.apache.cocoon.matching.PreparableMatcher
Throws:
org.apache.cocoon.sitemap.PatternException

preparedMatch

public Map preparedMatch(Object preparedPattern,
                         Map objectModel,
                         Parameters parameters)
                  throws org.apache.cocoon.sitemap.PatternException
Match the prepared pattern against the value returned by getMatchString(Map, Parameters).

Specified by:
preparedMatch in interface org.apache.cocoon.matching.PreparableMatcher
Throws:
org.apache.cocoon.sitemap.PatternException

getMatchString

protected abstract String getMatchString(Map objectModel,
                                         Parameters parameters)
Get the string to test against the regular expression. To be defined by concrete subclasses.



Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.