Class UriMatchTemplate.UriMatchTemplateParser

java.lang.Object
io.micronaut.http.uri.UriTemplate.UriTemplateParser
io.micronaut.http.uri.UriMatchTemplate.UriMatchTemplateParser
Direct Known Subclasses:
UriTypeMatchTemplate.TypedUriMatchTemplateParser
Enclosing class:
UriMatchTemplate

protected static class UriMatchTemplate.UriMatchTemplateParser extends UriTemplate.UriTemplateParser

Extended version of UriTemplate.UriTemplateParser that builds a regular expression to match a path. Note that fragments (#) and queries (?) are ignored for the purposes of matching.

  • Constructor Details

    • UriMatchTemplateParser

      protected UriMatchTemplateParser(String templateText, UriMatchTemplate matchTemplate)
      Parameters:
      templateText - The template
      matchTemplate - The Uri match template
  • Method Details

    • getMatchTemplate

      public UriMatchTemplate getMatchTemplate()
      Returns:
      The URI match template
    • addRawContentSegment

      protected void addRawContentSegment(List<UriTemplate.PathSegment> segments, String value, boolean isQuerySegment)
      Description copied from class: UriTemplate.UriTemplateParser
      Adds a raw content segment.
      Overrides:
      addRawContentSegment in class UriTemplate.UriTemplateParser
      Parameters:
      segments - The segments
      value - The value
      isQuerySegment - Whether is a query segment
    • addVariableSegment

      protected void addVariableSegment(List<UriTemplate.PathSegment> segments, String variable, String prefix, String delimiter, boolean encode, boolean repeatPrefix, String modifierStr, char modifierChar, char operator, String previousDelimiter, boolean isQuerySegment)
      Description copied from class: UriTemplate.UriTemplateParser
      Adds a new variable segment.
      Overrides:
      addVariableSegment in class UriTemplate.UriTemplateParser
      Parameters:
      segments - The segments to augment
      variable - The variable
      prefix - The prefix to use when expanding the variable
      delimiter - The delimiter to use when expanding the variable
      encode - Whether to URL encode the variable
      repeatPrefix - Whether to repeat the prefix for each expanded variable
      modifierStr - The modifier string
      modifierChar - The modifier as char
      operator - The currently active operator
      previousDelimiter - The delimiter to use if a variable appeared before this variable
      isQuerySegment - Whether is a query segment
    • getVariablePattern

      protected String getVariablePattern(String variable, char operator)
      Parameters:
      variable - The variable
      operator - The operator
      Returns:
      The variable match pattern