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

pack-priv Class CaptureTheRestPathElement

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

A path element representing capturing the rest of a path. In the pattern '/foo/{*foobar}' the /{*foobar} is represented as a CaptureTheRestPathElement.
Author
Andy Clement
Since
5.0

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
CaptureTheRestPathElement(int
position of the path element within the path pattern text
pos
,
char[]
a character array containing contents like '{' '*' 'a' 'b' '}'
captureDescriptor
,
char
the separator used in the path pattern
separator
)

Create a new CaptureTheRestPathElement instance.

Method Summary

Modifier and TypeMethod and Description
public int
getCaptureCount()

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

Return the number of variables captured by the path element.

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 int
getWildcardCount()

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

Return the number of wildcard elements (*, ?) in the path element.

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.

private String
pathToString(int fromSegment, List<PathContainer.Element> pathElements)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

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

Field Detail

variableNameback to summary
private final String variableName

Constructor Detail

CaptureTheRestPathElementback to summary
pack-priv CaptureTheRestPathElement(int pos, char[] captureDescriptor, char separator)

Create a new CaptureTheRestPathElement instance.

Parameters
pos:int

position of the path element within the path pattern text

captureDescriptor:char[]

a character array containing contents like '{' '*' 'a' 'b' '}'

separator:char

the separator used in the path pattern

Method Detail

getCaptureCountback to summary
public int getCaptureCount()

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

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

Return the number of variables captured by the path element.

Annotations
@Override
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
getWildcardCountback to summary
public int getWildcardCount()

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

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

Return the number of wildcard elements (*, ?) in the path element.

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
pathToStringback to summary
private String pathToString(int fromSegment, List<PathContainer.Element> pathElements)
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