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

pack-priv Class WildcardPathElement

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

A wildcard path element. In the pattern '/foo/*/goo' the * is represented by a WildcardPathElement. Within a path it matches at least one character but at the end of a path it can match zero characters.
Author
Andy Clement
Since
5.0

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
WildcardPathElement(int pos, 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 int
getScore()

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

Return the score for this PathElement, combined score is used to compare parsed patterns.
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.

Matching on a WildcardPathElement is quite straight forward.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.springframework.web.util.pattern.PathElement:
getCaptureCountisLiteralisNoMorePattern

Constructor Detail

WildcardPathElementback to summary
public WildcardPathElement(int pos, 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
getScoreback to summary
public int getScore()

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

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

Return the score for this PathElement, combined score is used to compare parsed patterns.

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.

Matching on a WildcardPathElement is quite straight forward. Scan the candidate from the candidateIndex onwards for the next separator or the end of the candidate.

Parameters
pathIndex:int

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

the current position within the candidate path

matchingContext:PathPattern.MatchingContext

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

encapsulates context for the match including the candidate

Returns:boolean

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

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.

Returns:String

a string representation of the object.

Annotations
@Override