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
Modifier | Constructor and Description |
---|---|
|
UriTypeMatchTemplate(java.lang.CharSequence templateString,
java.lang.Class... variableTypes) |
protected |
UriTypeMatchTemplate(java.lang.CharSequence templateString,
java.util.List<UriTemplate.PathSegment> segments,
java.util.regex.Pattern matchPattern,
java.lang.Class[] variableTypes,
java.util.List<UriMatchVariable> variables) |
Modifier and Type | Method and Description |
---|---|
protected UriTemplate.UriTemplateParser |
createParser(java.lang.String templateString,
java.lang.Object... parserArguments)
Creates a parser.
|
java.lang.String |
expand(java.util.Map<java.lang.String,java.lang.Object> parameters)
Expand the string with the given parameters.
|
UriTypeMatchTemplate |
nest(java.lang.CharSequence uriTemplate)
Nests another URI template with this template.
|
UriTypeMatchTemplate |
nest(java.lang.CharSequence uriTemplate,
java.lang.Class... variableTypes) |
protected UriMatchTemplate |
newUriMatchTemplate(java.lang.CharSequence uriTemplate,
java.util.List<UriTemplate.PathSegment> newSegments,
java.util.regex.Pattern newPattern,
java.util.List<UriMatchVariable> variables) |
protected java.lang.String |
resolveTypePattern(java.lang.Class variableType,
java.lang.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(java.lang.CharSequence templateString, java.lang.Class... variableTypes)
templateString
- The templatevariableTypes
- The variable typesprotected UriTypeMatchTemplate(java.lang.CharSequence templateString, java.util.List<UriTemplate.PathSegment> segments, java.util.regex.Pattern matchPattern, java.lang.Class[] variableTypes, java.util.List<UriMatchVariable> variables)
templateString
- The templatesegments
- The segmentsmatchPattern
- The match patternvariableTypes
- The variable typesvariables
- The variablespublic UriTypeMatchTemplate nest(java.lang.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(java.lang.CharSequence uriTemplate, java.lang.Class... variableTypes)
uriTemplate
- The URI templatevariableTypes
- The variable typespublic java.lang.String expand(java.util.Map<java.lang.String,java.lang.Object> parameters)
UriTemplate
expand
in class UriTemplate
parameters
- The parametersprotected UriTemplate.UriTemplateParser createParser(java.lang.String templateString, java.lang.Object... parserArguments)
UriTemplate
createParser
in class UriMatchTemplate
templateString
- The templateparserArguments
- The parsed argumentsprotected UriMatchTemplate newUriMatchTemplate(java.lang.CharSequence uriTemplate, java.util.List<UriTemplate.PathSegment> newSegments, java.util.regex.Pattern newPattern, java.util.List<UriMatchVariable> variables)
newUriMatchTemplate
in class UriMatchTemplate
uriTemplate
- The templatenewSegments
- The list of new segmentsnewPattern
- The list of new pattersvariables
- The variablesUriMatchTemplate
protected java.lang.String resolveTypePattern(java.lang.Class variableType, java.lang.String variable, char operator)
variableType
- The variable typevariable
- The variableoperator
- The operator