Package io.micronaut.http.uri
Class UriMatchTemplate.UriMatchTemplateParser
java.lang.Object
io.micronaut.http.uri.UriTemplate.UriTemplateParser
io.micronaut.http.uri.UriMatchTemplate.UriMatchTemplateParser
- Direct Known Subclasses:
UriTypeMatchTemplate.TypedUriMatchTemplateParser
- Enclosing class:
- UriMatchTemplate
protected static class UriMatchTemplate.UriMatchTemplateParser
extends UriTemplate.UriTemplateParser
Extended version of UriTemplate.UriTemplateParser
that builds a regular expression to match a path.
Note that fragments (#) and queries (?) are ignored for the purposes of matching.
-
Constructor Summary
ModifierConstructorDescriptionprotected
UriMatchTemplateParser
(String templateText, UriMatchTemplate matchTemplate) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRawContentSegment
(List<UriTemplate.PathSegment> segments, String value, boolean isQuerySegment) Adds a raw content segment.protected void
addVariableSegment
(List<UriTemplate.PathSegment> segments, String variable, String prefix, String delimiter, boolean encode, boolean repeatPrefix, String modifierStr, char modifierChar, char operator, String previousDelimiter, boolean isQuerySegment) Adds a new variable segment.protected String
getVariablePattern
(String variable, char operator) Methods inherited from class io.micronaut.http.uri.UriTemplate.UriTemplateParser
parse
-
Constructor Details
-
UriMatchTemplateParser
- Parameters:
templateText
- The templatematchTemplate
- The Uri match template
-
-
Method Details
-
getMatchTemplate
- Returns:
- The URI match template
-
addRawContentSegment
protected void addRawContentSegment(List<UriTemplate.PathSegment> segments, String value, boolean isQuerySegment) Description copied from class:UriTemplate.UriTemplateParser
Adds a raw content segment.- Overrides:
addRawContentSegment
in classUriTemplate.UriTemplateParser
- Parameters:
segments
- The segmentsvalue
- The valueisQuerySegment
- Whether is a query segment
-
addVariableSegment
protected void addVariableSegment(List<UriTemplate.PathSegment> segments, String variable, String prefix, String delimiter, boolean encode, boolean repeatPrefix, String modifierStr, char modifierChar, char operator, String previousDelimiter, boolean isQuerySegment) Description copied from class:UriTemplate.UriTemplateParser
Adds a new variable segment.- Overrides:
addVariableSegment
in classUriTemplate.UriTemplateParser
- Parameters:
segments
- The segments to augmentvariable
- The variableprefix
- The prefix to use when expanding the variabledelimiter
- The delimiter to use when expanding the variableencode
- Whether to URL encode the variablerepeatPrefix
- Whether to repeat the prefix for each expanded variablemodifierStr
- The modifier stringmodifierChar
- The modifier as charoperator
- The currently active operatorpreviousDelimiter
- The delimiter to use if a variable appeared before this variableisQuerySegment
- Whether is a query segment
-
getVariablePattern
- Parameters:
variable
- The variableoperator
- The operator- Returns:
- The variable match pattern
-