org.apache.cocoon.matching
Class AbstractWildcardMatcher

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.matching.AbstractPreparableMatcher
              |
              +--org.apache.cocoon.matching.AbstractWildcardMatcher
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.logger.Loggable, Matcher, PreparableMatcher, org.apache.avalon.framework.thread.ThreadSafe
Direct Known Subclasses:
CachingWildcardMatcher, WildcardHeaderMatcher, WildcardHostMatcher, WildcardMatcher, WildcardParameterMatcher, WildcardRequestAttributeMatcher, WildcardRequestParameterMatcher, WildcardSessionAttributeMatcher, WildcardURIMatcher

public abstract class AbstractWildcardMatcher
extends AbstractPreparableMatcher
implements org.apache.avalon.framework.thread.ThreadSafe

Base class for wildcard matchers

Version:
CVS $Id: AbstractWildcardMatcher.java,v 1.4 2002/02/22 07:03:52 cziegeler Exp $
Author:
Sylvain Wallez

Fields inherited from interface org.apache.cocoon.matching.Matcher
ROLE
 
Constructor Summary
AbstractWildcardMatcher()
           
 
Method Summary
protected abstract  java.lang.String getMatchString(java.util.Map objectModel, org.apache.avalon.framework.parameters.Parameters parameters)
          Get the string to test against the wildcard expression.
 java.util.Map preparedMatch(java.lang.Object preparedPattern, java.util.Map objectModel, org.apache.avalon.framework.parameters.Parameters parameters)
          Match the prepared pattern against the result of getMatchString(Map, Parameters).
 java.lang.Object preparePattern(java.lang.String pattern)
          Compile the pattern in an int[].
 
Methods inherited from class org.apache.cocoon.matching.AbstractPreparableMatcher
match
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWildcardMatcher

public AbstractWildcardMatcher()
Method Detail

preparePattern

public java.lang.Object preparePattern(java.lang.String pattern)
Compile the pattern in an int[].
Following copied from interface: org.apache.cocoon.matching.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.
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)
Match the prepared pattern against the result of getMatchString(Map, Parameters).
Following copied from interface: org.apache.cocoon.matching.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.

getMatchString

protected abstract java.lang.String getMatchString(java.util.Map objectModel,
                                                   org.apache.avalon.framework.parameters.Parameters parameters)
Get the string to test against the wildcard expression. To be defined by concrete subclasses.


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.