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.
Modifier | Constructor and Description |
---|---|
protected |
UriMatchTemplateParser(String templateText,
UriMatchTemplate matchTemplate) |
Modifier and Type | Method and Description |
---|---|
protected 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.
|
UriMatchTemplate |
getMatchTemplate() |
protected String |
getVariablePattern(String variable,
char operator) |
parse
protected UriMatchTemplateParser(String templateText, UriMatchTemplate matchTemplate)
templateText
- The templatematchTemplate
- The Uri match templatepublic UriMatchTemplate getMatchTemplate()
protected void addRawContentSegment(List<UriTemplate.PathSegment> segments, String value, boolean isQuerySegment)
UriTemplate.UriTemplateParser
addRawContentSegment
in class UriTemplate.UriTemplateParser
segments
- The segmentsvalue
- The valueisQuerySegment
- Whether is a query segmentprotected 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)
UriTemplate.UriTemplateParser
addVariableSegment
in class UriTemplate.UriTemplateParser
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