Class UriTypeMatchTemplate
java.lang.Object
io.micronaut.http.uri.UriTemplate
io.micronaut.http.uri.UriMatchTemplate
io.micronaut.http.uri.UriTypeMatchTemplate
- All Implemented Interfaces:
UriMatcher, Comparable<UriTemplate>
A UriMatchTemplate that allows specifying types for the URI variables.
- Since:
- 1.0
- Author:
- Graeme Rocher
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA typed uri match templated parser.Nested classes/interfaces inherited from class UriMatchTemplate
UriMatchTemplate.DefaultUriMatchInfo, UriMatchTemplate.UriMatchTemplateParserNested classes/interfaces inherited from class UriTemplate
UriTemplate.PathSegment, UriTemplate.UriTemplateParser -
Field Summary
Fields inherited from class UriMatchTemplate
pattern, VARIABLE_MATCH_PATTERN, variablesFields inherited from class UriTemplate
templateString -
Constructor Summary
ConstructorsModifierConstructorDescriptionUriTypeMatchTemplate(CharSequence templateString, Class<?>... variableTypes) protectedUriTypeMatchTemplate(CharSequence templateString, List<UriTemplate.PathSegment> segments, Pattern matchPattern, Class<?>[] variableTypes, List<UriMatchVariable> variables) -
Method Summary
Modifier and TypeMethodDescriptionprotected UriTemplate.UriTemplateParsercreateParser(String templateString, Object... parserArguments) Creates a parser.Expand the string with the given parameters.nest(CharSequence uriTemplate) Nests another URI template with this template.nest(CharSequence uriTemplate, Class<?>... variableTypes) protected UriMatchTemplatenewUriMatchTemplate(CharSequence uriTemplate, List<UriTemplate.PathSegment> newSegments, Pattern newPattern, List<UriMatchVariable> variables) protected StringresolveTypePattern(Class<?> variableType, String variable, char operator) Methods inherited from class UriMatchTemplate
getVariableNames, getVariables, match, newUriTemplate, of, toPathString, tryMatchMethods inherited from class UriTemplate
buildNestedSegments, compareTo, equals, expand, getPathVariableSegmentCount, getRawSegmentCount, getRawSegmentLength, getTemplateString, getVariableSegmentCount, hashCode, nest, normalizeNested, toString, toStringMethods inherited from interface UriMatcher
match
-
Constructor Details
-
UriTypeMatchTemplate
- Parameters:
templateString- The templatevariableTypes- The variable types
-
UriTypeMatchTemplate
protected UriTypeMatchTemplate(CharSequence templateString, List<UriTemplate.PathSegment> segments, Pattern matchPattern, Class<?>[] variableTypes, List<UriMatchVariable> variables) - Parameters:
templateString- The templatesegments- The segmentsmatchPattern- The match patternvariableTypes- The variable typesvariables- The variables
-
-
Method Details
-
nest
Description copied from class:UriTemplateNests another URI template with this template.- Overrides:
nestin classUriMatchTemplate- Parameters:
uriTemplate- The URI template. If it does not begin with forward slash it will automatically be appended with forward slash- Returns:
- The new URI template
-
nest
- Parameters:
uriTemplate- The URI templatevariableTypes- The variable types- Returns:
- The new URI template
-
expand
Description copied from class:UriTemplateExpand the string with the given parameters.- Overrides:
expandin classUriTemplate- Parameters:
parameters- The parameters- Returns:
- The expanded URI
-
createParser
protected UriTemplate.UriTemplateParser createParser(String templateString, Object... parserArguments) Description copied from class:UriTemplateCreates a parser.- Overrides:
createParserin classUriMatchTemplate- Parameters:
templateString- The templateparserArguments- The parsed arguments- Returns:
- The created parser
-
newUriMatchTemplate
protected UriMatchTemplate newUriMatchTemplate(CharSequence uriTemplate, List<UriTemplate.PathSegment> newSegments, Pattern newPattern, List<UriMatchVariable> variables) - Overrides:
newUriMatchTemplatein classUriMatchTemplate- Parameters:
uriTemplate- The templatenewSegments- The list of new segmentsnewPattern- The list of new pattersvariables- The variables- Returns:
- An instance of
UriMatchTemplate
-
resolveTypePattern
-