Package io.micronaut.http.uri
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
Modifier and TypeClassDescriptionprotected static class
A typed uri match templated parser.Nested classes/interfaces inherited from class io.micronaut.http.uri.UriMatchTemplate
UriMatchTemplate.DefaultUriMatchInfo, UriMatchTemplate.UriMatchTemplateParser
Nested classes/interfaces inherited from class io.micronaut.http.uri.UriTemplate
UriTemplate.PathSegment, UriTemplate.UriTemplateParser
-
Field Summary
Fields inherited from class io.micronaut.http.uri.UriMatchTemplate
pattern, VARIABLE_MATCH_PATTERN, variables
Fields inherited from class io.micronaut.http.uri.UriTemplate
templateString
-
Constructor Summary
ModifierConstructorDescriptionUriTypeMatchTemplate
(CharSequence templateString, Class<?>... variableTypes) protected
UriTypeMatchTemplate
(CharSequence templateString, List<UriTemplate.PathSegment> segments, Pattern matchPattern, Class<?>[] variableTypes, List<UriMatchVariable> variables) -
Method Summary
Modifier and TypeMethodDescriptionprotected UriTemplate.UriTemplateParser
createParser
(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 UriMatchTemplate
newUriMatchTemplate
(CharSequence uriTemplate, List<UriTemplate.PathSegment> newSegments, Pattern newPattern, List<UriMatchVariable> variables) protected String
resolveTypePattern
(Class<?> variableType, String variable, char operator) Methods inherited from class io.micronaut.http.uri.UriMatchTemplate
getVariableNames, getVariables, match, newUriTemplate, of, toPathString, tryMatch
Methods inherited from class io.micronaut.http.uri.UriTemplate
buildNestedSegments, compareTo, equals, expand, getPathVariableSegmentCount, getRawSegmentCount, getRawSegmentLength, getTemplateString, getVariableSegmentCount, hashCode, nest, normalizeNested, toString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.http.uri.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:UriTemplate
Nests another URI template with this template.- Overrides:
nest
in 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:UriTemplate
Expand the string with the given parameters.- Overrides:
expand
in classUriTemplate
- Parameters:
parameters
- The parameters- Returns:
- The expanded URI
-
createParser
protected UriTemplate.UriTemplateParser createParser(String templateString, Object... parserArguments) Description copied from class:UriTemplate
Creates a parser.- Overrides:
createParser
in 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:
newUriMatchTemplate
in classUriMatchTemplate
- Parameters:
uriTemplate
- The templatenewSegments
- The list of new segmentsnewPattern
- The list of new pattersvariables
- The variables- Returns:
- An instance of
UriMatchTemplate
-
resolveTypePattern
- Parameters:
variableType
- The variable typevariable
- The variableoperator
- The operator- Returns:
- The variable match pattern
-