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,java.lang.Comparable<UriTemplate>
public class UriTypeMatchTemplate extends UriMatchTemplate
A
UriMatchTemplatethat allows specifying types for the URI variables.- Since:
- 1.0
- See Also:
UriMatchTemplate,UriTemplate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classUriTypeMatchTemplate.TypedUriMatchTemplateParserA 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
Constructors Modifier Constructor Description UriTypeMatchTemplate(java.lang.CharSequence templateString, java.lang.Class... variableTypes)protectedUriTypeMatchTemplate(java.lang.CharSequence templateString, java.util.List<UriTemplate.PathSegment> segments, java.util.regex.Pattern matchPattern, java.lang.Class[] variableTypes, java.util.List<UriMatchVariable> variables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UriTemplate.UriTemplateParsercreateParser(java.lang.String templateString, java.lang.Object... parserArguments)Creates a parser.java.lang.Stringexpand(java.util.Map<java.lang.String,java.lang.Object> parameters)Expand the string with the given parameters.UriTypeMatchTemplatenest(java.lang.CharSequence uriTemplate)Nests another URI template with this template.UriTypeMatchTemplatenest(java.lang.CharSequence uriTemplate, java.lang.Class... variableTypes)protected UriMatchTemplatenewUriMatchTemplate(java.lang.CharSequence uriTemplate, java.util.List<UriTemplate.PathSegment> newSegments, java.util.regex.Pattern newPattern, java.util.List<UriMatchVariable> variables)protected java.lang.StringresolveTypePattern(java.lang.Class variableType, java.lang.String variable, char operator)-
Methods inherited from class io.micronaut.http.uri.UriMatchTemplate
getVariableNames, getVariables, match, newUriTemplate, of, toPathString
-
Methods inherited from class io.micronaut.http.uri.UriTemplate
buildNestedSegments, compareTo, equals, expand, getPathVariableSegmentCount, getRawSegmentCount, getRawSegmentLength, 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 Detail
-
UriTypeMatchTemplate
public UriTypeMatchTemplate(java.lang.CharSequence templateString, java.lang.Class... variableTypes)- Parameters:
templateString- The templatevariableTypes- The variable types
-
UriTypeMatchTemplate
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)- Parameters:
templateString- The templatesegments- The segmentsmatchPattern- The match patternvariableTypes- The variable typesvariables- The variables
-
-
Method Detail
-
nest
public UriTypeMatchTemplate nest(java.lang.CharSequence uriTemplate)
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
public UriTypeMatchTemplate nest(java.lang.CharSequence uriTemplate, java.lang.Class... variableTypes)
- Parameters:
uriTemplate- The URI templatevariableTypes- The variable types- Returns:
- The new URI template
-
expand
public java.lang.String expand(java.util.Map<java.lang.String,java.lang.Object> parameters)
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(java.lang.String templateString, java.lang.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(java.lang.CharSequence uriTemplate, java.util.List<UriTemplate.PathSegment> newSegments, java.util.regex.Pattern newPattern, java.util.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
protected java.lang.String resolveTypePattern(java.lang.Class variableType, java.lang.String variable, char operator)- Parameters:
variableType- The variable typevariable- The variableoperator- The operator- Returns:
- The variable match pattern
-
-