public class UriTypeMatchTemplate extends UriMatchTemplate
A UriMatchTemplate
that allows specifying types for the URI variables.
UriMatchTemplate
,
UriTemplate
Modifier and Type | Class and Description |
---|---|
protected static class |
UriTypeMatchTemplate.TypedUriMatchTemplateParser
A typed uri match templated parser.
|
UriMatchTemplate.DefaultUriMatchInfo, UriMatchTemplate.UriMatchTemplateParser
UriTemplate.PathSegment, UriTemplate.UriTemplateParser
pattern, VARIABLE_MATCH_PATTERN, variables
templateString
Modifier | Constructor and Description |
---|---|
|
UriTypeMatchTemplate(CharSequence templateString,
Class... variableTypes) |
protected |
UriTypeMatchTemplate(CharSequence templateString,
List<UriTemplate.PathSegment> segments,
Pattern matchPattern,
Class[] variableTypes,
List<UriMatchVariable> variables) |
Modifier and Type | Method and Description |
---|---|
protected UriTemplate.UriTemplateParser |
createParser(String templateString,
Object... parserArguments)
Creates a parser.
|
String |
expand(Map<String,Object> parameters)
Expand the string with the given parameters.
|
UriTypeMatchTemplate |
nest(CharSequence uriTemplate)
Nests another URI template with this template.
|
UriTypeMatchTemplate |
nest(CharSequence uriTemplate,
Class... variableTypes) |
protected UriMatchTemplate |
newUriMatchTemplate(CharSequence uriTemplate,
List<UriTemplate.PathSegment> newSegments,
Pattern newPattern,
List<UriMatchVariable> variables) |
protected String |
resolveTypePattern(Class variableType,
String variable,
char operator) |
getVariableNames, getVariables, match, newUriTemplate, of, toPathString
buildNestedSegments, compareTo, equals, expand, getPathVariableSegmentCount, getRawSegmentCount, getRawSegmentLength, getVariableSegmentCount, hashCode, nest, normalizeNested, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
match
public UriTypeMatchTemplate(CharSequence templateString, Class... variableTypes)
templateString
- The templatevariableTypes
- The variable typesprotected UriTypeMatchTemplate(CharSequence templateString, List<UriTemplate.PathSegment> segments, Pattern matchPattern, Class[] variableTypes, List<UriMatchVariable> variables)
templateString
- The templatesegments
- The segmentsmatchPattern
- The match patternvariableTypes
- The variable typesvariables
- The variablespublic UriTypeMatchTemplate nest(CharSequence uriTemplate)
UriTemplate
nest
in class UriMatchTemplate
uriTemplate
- The URI template. If it does not begin with forward slash it will automatically be appended with forward slashpublic UriTypeMatchTemplate nest(CharSequence uriTemplate, Class... variableTypes)
uriTemplate
- The URI templatevariableTypes
- The variable typespublic String expand(Map<String,Object> parameters)
UriTemplate
expand
in class UriTemplate
parameters
- The parametersprotected UriTemplate.UriTemplateParser createParser(String templateString, Object... parserArguments)
UriTemplate
createParser
in class UriMatchTemplate
templateString
- The templateparserArguments
- The parsed argumentsprotected UriMatchTemplate newUriMatchTemplate(CharSequence uriTemplate, List<UriTemplate.PathSegment> newSegments, Pattern newPattern, List<UriMatchVariable> variables)
newUriMatchTemplate
in class UriMatchTemplate
uriTemplate
- The templatenewSegments
- The list of new segmentsnewPattern
- The list of new pattersvariables
- The variablesUriMatchTemplate