abstract class PathElement
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static int |
CAPTURE_VARIABLE_WEIGHT |
protected PathElement |
next |
protected static MultiValueMap<java.lang.String,java.lang.String> |
NO_PARAMETERS |
protected int |
pos |
protected PathElement |
prev |
protected char |
separator |
protected static int |
WILDCARD_WEIGHT |
Constructor and Description |
---|
PathElement(int pos,
char separator)
Create a new path element.
|
Modifier and Type | Method and Description |
---|---|
int |
getCaptureCount()
Return the number of variables captured by the path element.
|
abstract char[] |
getChars() |
abstract int |
getNormalizedLength() |
int |
getScore()
Return the score for this PathElement, combined score is used to compare parsed patterns.
|
int |
getWildcardCount()
Return the number of wildcard elements (*, ?) in the path element.
|
protected boolean |
isNoMorePattern() |
abstract boolean |
matches(int candidatePos,
PathPattern.MatchingContext matchingContext)
Attempt to match this path element.
|
protected static final int WILDCARD_WEIGHT
protected static final int CAPTURE_VARIABLE_WEIGHT
protected static final MultiValueMap<java.lang.String,java.lang.String> NO_PARAMETERS
protected final int pos
protected final char separator
@Nullable protected PathElement next
@Nullable protected PathElement prev
PathElement(int pos, char separator)
pos
- the position where this path element starts in the pattern dataseparator
- the separator in use in the path patternpublic abstract boolean matches(int candidatePos, PathPattern.MatchingContext matchingContext)
candidatePos
- the current position within the candidate pathmatchingContext
- encapsulates context for the match including the candidatetrue
if it matches, otherwise false
public abstract int getNormalizedLength()
public abstract char[] getChars()
public int getCaptureCount()
public int getWildcardCount()
public int getScore()
protected final boolean isNoMorePattern()