class CaptureVariablePathElement extends PathElement
CaptureVariablePathElement
. There
must be at least one character to bind to the variable.Modifier and Type | Field and Description |
---|---|
private java.util.regex.Pattern |
constraintPattern |
private java.lang.String |
variableName |
CAPTURE_VARIABLE_WEIGHT, next, NO_PARAMETERS, pos, prev, separator, WILDCARD_WEIGHT
Constructor and Description |
---|
CaptureVariablePathElement(int pos,
char[] captureDescriptor,
boolean caseSensitive,
char separator)
Create a new
CaptureVariablePathElement instance. |
Modifier and Type | Method and Description |
---|---|
int |
getCaptureCount()
Return the number of variables captured by the path element.
|
char[] |
getChars() |
int |
getNormalizedLength()
Return the length of the path element where captures are considered to be one character long.
|
int |
getScore()
Return the score for this PathElement, combined score is used to compare parsed patterns.
|
java.lang.String |
getVariableName() |
int |
getWildcardCount()
Return the number of wildcard elements (*, ?) in the path element.
|
boolean |
matches(int pathIndex,
PathPattern.MatchingContext matchingContext)
Attempt to match this path element.
|
java.lang.String |
toString() |
isNoMorePattern
private final java.lang.String variableName
@Nullable private java.util.regex.Pattern constraintPattern
CaptureVariablePathElement(int pos, char[] captureDescriptor, boolean caseSensitive, char separator)
CaptureVariablePathElement
instance.pos
- the position in the pattern of this capture elementcaptureDescriptor
- is of the form {AAAAA[:pattern]}public boolean matches(int pathIndex, PathPattern.MatchingContext matchingContext)
PathElement
matches
in class PathElement
pathIndex
- the current position within the candidate pathmatchingContext
- encapsulates context for the match including the candidatetrue
if it matches, otherwise false
public java.lang.String getVariableName()
public int getNormalizedLength()
PathElement
getNormalizedLength
in class PathElement
public int getWildcardCount()
PathElement
getWildcardCount
in class PathElement
public int getCaptureCount()
PathElement
getCaptureCount
in class PathElement
public int getScore()
PathElement
getScore
in class PathElement
public java.lang.String toString()
toString
in class java.lang.Object
public char[] getChars()
getChars
in class PathElement