cn.dreampie.common.util.matcher
类 AntPathMatcher

java.lang.Object
  继承者 cn.dreampie.common.util.matcher.AntPathMatcher
所有已实现的接口:
Matcher

public class AntPathMatcher
extends Object
implements Matcher

Created by ice on 14-9-10.


字段摘要
static String DEFAULT_PATH_SEPARATOR
          Default path separator: "/"
 
构造方法摘要
AntPathMatcher()
           
 
方法摘要
protected  boolean doMatch(String pattern, String path, boolean fullMatch)
          Actually match the given path against the given pattern.
 String extractPathWithinPattern(String pattern, String path)
          Given a pattern and a full path, determine the pattern-mapped part.
static AntPathMatcher instance()
           
 boolean isPattern(String path)
           
static void main(String[] args)
           
 boolean match(String pattern, String path)
           
 boolean matches(String pattern, String source)
          Returns true if the given source matches the specified pattern, false otherwise.
 boolean matchStart(String pattern, String path)
           
 void setPathSeparator(String pathSeparator)
          Set the path separator to use for pattern parsing.
static String[] tokenizeToStringArray(String str, String delimiters)
           
static String[] tokenizeToStringArray(String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens)
           
static String[] toStringArray(Collection collection)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

DEFAULT_PATH_SEPARATOR

public static final String DEFAULT_PATH_SEPARATOR
Default path separator: "/"

另请参见:
常量字段值
构造方法详细信息

AntPathMatcher

public AntPathMatcher()
方法详细信息

instance

public static AntPathMatcher instance()

tokenizeToStringArray

public static String[] tokenizeToStringArray(String str,
                                             String delimiters)

tokenizeToStringArray

public static String[] tokenizeToStringArray(String str,
                                             String delimiters,
                                             boolean trimTokens,
                                             boolean ignoreEmptyTokens)

toStringArray

public static String[] toStringArray(Collection collection)

main

public static void main(String[] args)

setPathSeparator

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

参数:
pathSeparator - pathSep

isPattern

public boolean isPattern(String path)

matches

public boolean matches(String pattern,
                       String source)
从接口 Matcher 复制的描述
Returns true if the given source matches the specified pattern, false otherwise.

指定者:
接口 Matcher 中的 matches
参数:
pattern - the pattern to match against
source - the source to match
返回:
true if the given source matches the specified pattern, false otherwise.

match

public boolean match(String pattern,
                     String path)

matchStart

public boolean matchStart(String pattern,
                          String path)

doMatch

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

参数:
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)
返回:
true if the supplied path matched, false if it didn't

extractPathWithinPattern

public String extractPathWithinPattern(String pattern,
                                       String path)
Given a pattern and a full path, determine the pattern-mapped part.

For example:

Assumes that match(java.lang.String, java.lang.String) returns true for pattern and path, but does not enforce this.

参数:
path - the path String to test
pattern - pattern to match against. Must not be null.
返回:
String


Copyright © 2015. All rights reserved.