类 PathElement
java.lang.Object
cn.taketoday.web.util.pattern.PathElement
- 直接已知子类:
CaptureTheRestPathElement,CaptureVariablePathElement,LiteralPathElement,RegexPathElement,SeparatorPathElement,SingleCharWildcardedPathElement,WildcardPathElement,WildcardTheRestPathElement
Common supertype for the Ast nodes created to represent a path pattern.
- 从以下版本开始:
- 4.0
- 作者:
- Andy Clement
-
字段概要
字段修饰符和类型字段说明protected static final intprotected PathElementprotected final intprotected PathElementprotected final charprotected static final int -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明intReturn the number of variables captured by the path element.abstract char[]getChars()abstract intReturn the length of the path element where captures are considered to be one character long.intgetScore()Return the score for this PathElement, combined score is used to compare parsed patterns.intReturn the number of wildcard elements (*, ?)booleanReturn whether this PathElement can be strictlycomparedagainst another element for matching.protected final booleanReturn if the there are no more PathElements in the pattern.abstract booleanmatches(int candidatePos, PathPattern.MatchingContext matchingContext) Attempt to match this path element.
-
字段详细资料
-
构造器详细资料
-
PathElement
PathElement(int pos, char separator) Create a new path element.- 参数:
pos- the position where this path element starts in the pattern dataseparator- the separator in use in the path pattern
-
-
方法详细资料
-
matches
Attempt to match this path element.- 参数:
candidatePos- the current position within the candidate pathmatchingContext- encapsulates context for the match including the candidate- 返回:
trueif it matches, otherwisefalse
-
getNormalizedLength
public abstract int getNormalizedLength()Return the length of the path element where captures are considered to be one character long.- 返回:
- the normalized length
-
getChars
public abstract char[] getChars() -
getCaptureCount
public int getCaptureCount()Return the number of variables captured by the path element. -
getWildcardCount
public int getWildcardCount()Return the number of wildcard elements (*, ?) in the path element. -
getScore
public int getScore()Return the score for this PathElement, combined score is used to compare parsed patterns. -
isLiteral
public boolean isLiteral()Return whether this PathElement can be strictlycomparedagainst another element for matching. -
isNoMorePattern
protected final boolean isNoMorePattern()Return if the there are no more PathElements in the pattern.- 返回:
trueif the there are no more elements
-