Top Description Fields Constructors Methods
org.springframework.web.util.pattern

pack-priv Class LiteralPathElement

extends PathElement
Class Inheritance
Imports
org.springframework.http.server.PathContainer.Element, .PathContainer.PathSegment, org.springframework.web.util.pattern.PathPattern.MatchingContext

A literal path element. In the pattern '/foo/bar/goo' there are three literal path elements 'foo', 'bar' and 'goo'.
Author
Andy Clement
Since
5.0

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
private final String
Inherited from org.springframework.web.util.pattern.PathElement:
CAPTURE_VARIABLE_WEIGHTnextNO_PARAMETERSposprevseparatorWILDCARD_WEIGHT

Constructor Summary

AccessConstructor and Description
public
LiteralPathElement(int pos, char[] literalText, boolean caseSensitive, char separator)

Method Summary

Modifier and TypeMethod and Description
public char[]
public int
getNormalizedLength()

Implements abstract org.springframework.web.util.pattern.PathElement.getNormalizedLength.

Return the length of the path element where captures are considered to be one character long.

public boolean
isLiteral()

Overrides org.springframework.web.util.pattern.PathElement.isLiteral.

Return whether this PathElement can be strictly compared against another element for matching.

public boolean
matches(int
the current position within the candidate path
pathIndex
,
PathPattern.MatchingContext
encapsulates context for the match including the candidate
matchingContext
)

Implements abstract org.springframework.web.util.pattern.PathElement.matches.

Attempt to match this path element.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.springframework.web.util.pattern.PathElement:
getCaptureCountgetScoregetWildcardCountisNoMorePattern

Field Detail

caseSensitiveback to summary
private final boolean caseSensitive
lenback to summary
private final int len
textback to summary
private final String text

Constructor Detail

LiteralPathElementback to summary
public LiteralPathElement(int pos, char[] literalText, boolean caseSensitive, char separator)

Method Detail

getCharsback to summary
public char[] getChars()

Implements abstract org.springframework.web.util.pattern.PathElement.getChars.

Annotations
@Override
getNormalizedLengthback to summary
public int getNormalizedLength()

Implements abstract org.springframework.web.util.pattern.PathElement.getNormalizedLength.

Doc from org.springframework.web.util.pattern.PathElement.getNormalizedLength.

Return the length of the path element where captures are considered to be one character long.

Returns:int

the normalized length

Annotations
@Override
isLiteralback to summary
public boolean isLiteral()

Overrides org.springframework.web.util.pattern.PathElement.isLiteral.

Doc from org.springframework.web.util.pattern.PathElement.isLiteral.

Return whether this PathElement can be strictly compared against another element for matching.

Annotations
@Override
matchesback to summary
public boolean matches(int pathIndex, PathPattern.MatchingContext matchingContext)

Implements abstract org.springframework.web.util.pattern.PathElement.matches.

Doc from org.springframework.web.util.pattern.PathElement.matches.

Attempt to match this path element.

Parameters
pathIndex:int

the current position within the candidate path

matchingContext:PathPattern.MatchingContext

encapsulates context for the match including the candidate

Returns:boolean

true if it matches, otherwise false

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override