java.lang.Object
org.xbib.net.path.spring.PathPatternParser
Parser for URI path patterns producing
PathPattern instances that can
then be matched to requests.
The PathPatternParser and PathPattern are specifically
designed for use with HTTP URL paths in web applications where a large number
of URI path patterns, continuously matched against incoming requests,
motivates the need for efficient matching.
For details of the path pattern syntax see PathPattern.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final PathPatternParserShared, read-only instance ofPathPatternParser. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturn theconfiguredpattern parsing options.booleanWhether case-sensitive pattern matching is enabled.booleanWhether optional trailing slashing match is enabled.booleanProcess the path pattern content, a character at a time, breaking it into path elements around separator boundaries and verifying the structure at each stage.voidsetCaseSensitive(boolean caseSensitive) Whether path pattern matching should be case-sensitive.voidsetMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator) Whether aPathPatternproduced by this parser should automatically match request paths with a trailing slash.voidsetPathOptions(PathContainer.Options pathOptions) Set options for parsing patterns.
-
Felddetails
-
defaultInstance
Shared, read-only instance ofPathPatternParser. Uses default settings:matchOptionalTrailingSeparator=truecaseSensitivetruepathOptions=PathContainer.Options.HTTP_PATH
-
-
Konstruktordetails
-
PathPatternParser
public PathPatternParser()
-
-
Methodendetails
-
match
-
setMatchOptionalTrailingSeparator
public void setMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator) Whether aPathPatternproduced by this parser should automatically match request paths with a trailing slash. If set totrueaPathPatternwithout a trailing slash will also match request paths with a trailing slash. If set tofalseaPathPatternwill only match request paths with a trailing slash. The default istrue. -
isMatchOptionalTrailingSeparator
public boolean isMatchOptionalTrailingSeparator()Whether optional trailing slashing match is enabled. -
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Whether path pattern matching should be case-sensitive. The default istrue. -
isCaseSensitive
public boolean isCaseSensitive()Whether case-sensitive pattern matching is enabled. -
setPathOptions
Set options for parsing patterns. These should be the same as the options used to parse input paths.org.springframework.http.server.PathContainer.Options#HTTP_PATHis used by default. -
getPathOptions
Return theconfiguredpattern parsing options. -
parse
Process the path pattern content, a character at a time, breaking it into path elements around separator boundaries and verifying the structure at each stage. Produces a PathPattern object that can be used for fast matching against paths.- Parameter:
pathPattern- the input path pattern, e.g. /project/{name}- Gibt zurück:
- a PathPattern for quickly matching paths against request paths
- Löst aus:
PatternParseException- in case of parse errors
-