org.codehaus.enunciate.util
Class AntPatternMatcher

java.lang.Object
  extended by org.codehaus.enunciate.util.AntPatternMatcher

public class AntPatternMatcher
extends java.lang.Object

Ant-style pattern matcher. By default, this matcher matches on FQN, so the path separator is the '.'. This code was kindly borrowed from the Spring Framework, which in turn borrowed it from Apache Ant.

Author:
Alef Arendsen, Juergen Hoeller, Rob Harrop, Ryan Heaton

Field Summary
static java.lang.String DEFAULT_PATH_SEPARATOR
          Default path separator: "."
 
Constructor Summary
AntPatternMatcher()
           
 
Method Summary
protected  boolean doMatch(java.lang.String pattern, java.lang.String path, boolean fullMatch)
          Actually match the given path against the given pattern.
 boolean isPattern(java.lang.String path)
          Whether this is a pattern.
 boolean match(java.lang.String pattern, java.lang.String path)
           
 void setPathSeparator(java.lang.String pathSeparator)
          Set the path separator to use for pattern parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PATH_SEPARATOR

public static final java.lang.String DEFAULT_PATH_SEPARATOR
Default path separator: "."

See Also:
Constant Field Values
Constructor Detail

AntPatternMatcher

public AntPatternMatcher()
Method Detail

setPathSeparator

public void setPathSeparator(java.lang.String pathSeparator)
Set the path separator to use for pattern parsing. Default is "/", as in Ant.

Parameters:
pathSeparator - The path separator.

isPattern

public boolean isPattern(java.lang.String path)
Whether this is a pattern.

Parameters:
path - The pattern.
Returns:
Whether the path is a pattern.

match

public boolean match(java.lang.String pattern,
                     java.lang.String path)

doMatch

protected boolean doMatch(java.lang.String pattern,
                          java.lang.String path,
                          boolean fullMatch)
Actually match the given path against the given pattern.

Parameters:
pattern - the pattern to match against
path - the path String to test
fullMatch - whether a full pattern match is required (else a pattern match as far as the given base path goes is sufficient)
Returns:
true if the supplied path matched, false if it didn't