类 InternalPathPatternParser
java.lang.Object
cn.taketoday.web.util.pattern.InternalPathPatternParser
Parser for URI template patterns. It breaks the path pattern into a number of
PathElements in a linked list. Instances are reusable but are not thread-safe.- 从以下版本开始:
- 4.0
- 作者:
- Andy Clement
-
字段概要
字段修饰符和类型字段说明private PathElementprivate PathElementprivate booleanprivate booleanprivate final PathPatternParserprivate intprivate char[]private int(专用程序包) intprivate intprivate intprivate intprivate boolean -
构造器概要
构造器构造器说明InternalPathPatternParser(PathPatternParser parentParser) Package private constructor for use inPathPatternParser.parse(java.lang.String). -
方法概要
修饰符和类型方法说明private PathElementUsed the knowledge built up whilst processing since the last path element to determine what kind of path element to create.private intfindRegexStart(char[] data, int offset) For a path element representing a captured variable, locate the constraint pattern.private char[]Package private delegate forPathPatternParser.parse(String).private booleanAfter processing a separator, a quick peek whether it is followed by a double wildcard (and only as the last path element).private voidpushPathElement(PathElement newPathElement) Push a path element to the chain being build.private voidrecordCapturedVariable(int pos, String variableName) Record a new captured variable.private voidReset all the flags and position markers computed during path element processing.private voidJust hit a ':' and want to jump over the regex specification for this variable. pos will be pointing at the ':', we want to skip until the }.
-
字段详细资料
-
parser
-
pathPatternData
private char[] pathPatternData -
pathPatternLength
private int pathPatternLength -
pos
int pos -
singleCharWildcardCount
private int singleCharWildcardCount -
wildcard
private boolean wildcard -
isCaptureTheRestVariable
private boolean isCaptureTheRestVariable -
insideVariableCapture
private boolean insideVariableCapture -
variableCaptureCount
private int variableCaptureCount -
pathElementStart
private int pathElementStart -
variableCaptureStart
private int variableCaptureStart -
capturedVariableNames
-
headPE
-
currentPE
-
-
构造器详细资料
-
InternalPathPatternParser
InternalPathPatternParser(PathPatternParser parentParser) Package private constructor for use inPathPatternParser.parse(java.lang.String).- 参数:
parentParser- reference back to the stateless, public parser
-
-
方法详细资料
-
parse
Package private delegate forPathPatternParser.parse(String). -
skipCaptureRegex
private void skipCaptureRegex()Just hit a ':' and want to jump over the regex specification for this variable. pos will be pointing at the ':', we want to skip until the }.Nested {...} pairs don't have to be escaped: /abc/{var:x{1,2}}/def
An escaped } will not be treated as the end of the regex: /abc/{var:x\\{y:}/def
A separator that should not indicate the end of the regex can be escaped:
-
peekDoubleWildcard
private boolean peekDoubleWildcard()After processing a separator, a quick peek whether it is followed by a double wildcard (and only as the last path element). -
pushPathElement
Push a path element to the chain being build.- 参数:
newPathElement- the new path element to add
-
getPathElementText
private char[] getPathElementText() -
createPathElement
Used the knowledge built up whilst processing since the last path element to determine what kind of path element to create.- 返回:
- the new path element
-
findRegexStart
private int findRegexStart(char[] data, int offset) For a path element representing a captured variable, locate the constraint pattern. Assumes there is a constraint pattern.- 参数:
data- a complete path expression, e.g. /aaa/bbb/{ccc:...}offset- the start of the capture pattern of interest- 返回:
- the index of the character after the ':' within the pattern expression relative to the start of the whole expression
-
resetPathElementState
private void resetPathElementState()Reset all the flags and position markers computed during path element processing. -
recordCapturedVariable
Record a new captured variable. If it clashes with an existing one then report an error.
-