Class UriMatchTemplate

    • Field Detail

      • VARIABLE_MATCH_PATTERN

        protected static final java.lang.String VARIABLE_MATCH_PATTERN
        See Also:
        Constant Field Values
      • pattern

        protected java.lang.StringBuilder pattern
    • Constructor Detail

      • UriMatchTemplate

        public UriMatchTemplate​(java.lang.CharSequence templateString)
        Construct a new URI template for the given template.
        Parameters:
        templateString - The template string
      • UriMatchTemplate

        protected UriMatchTemplate​(java.lang.CharSequence templateString,
                                   java.lang.Object... parserArguments)
        Construct a new URI template for the given template.
        Parameters:
        templateString - The template string
        parserArguments - The parsed arguments
      • UriMatchTemplate

        protected UriMatchTemplate​(java.lang.CharSequence templateString,
                                   java.util.List<UriTemplate.PathSegment> segments,
                                   java.util.regex.Pattern matchPattern,
                                   java.util.List<UriMatchVariable> variables)
        Parameters:
        templateString - The template
        segments - The list of segments
        matchPattern - The match pattern
        variables - The variables
    • Method Detail

      • newUriMatchTemplate

        protected UriMatchTemplate newUriMatchTemplate​(java.lang.CharSequence uriTemplate,
                                                       java.util.List<UriTemplate.PathSegment> newSegments,
                                                       java.util.regex.Pattern newPattern,
                                                       java.util.List<UriMatchVariable> variables)
        Parameters:
        uriTemplate - The template
        newSegments - The list of new segments
        newPattern - The list of new patters
        variables - The variables
        Returns:
        An instance of UriMatchTemplate
      • getVariableNames

        public java.util.List<java.lang.String> getVariableNames()
        Returns:
        The variables this template expects
      • getVariables

        public java.util.List<UriMatchVariable> getVariables()
        Returns:
        The variables this template expects
      • toPathString

        public java.lang.String toPathString()
        Returns the path string excluding any query variables.
        Returns:
        The path string
      • match

        public java.util.Optional<UriMatchInfo> match​(java.lang.String uri)
        Match the given URI string.
        Specified by:
        match in interface UriMatcher
        Parameters:
        uri - The uRI
        Returns:
        True if it matches
      • nest

        public UriMatchTemplate nest​(java.lang.CharSequence uriTemplate)
        Description copied from class: UriTemplate
        Nests another URI template with this template.
        Overrides:
        nest in class UriTemplate
        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
      • of

        public static UriMatchTemplate of​(java.lang.String uri)
        Create a new UriTemplate for the given URI.
        Parameters:
        uri - The URI
        Returns:
        The template
      • createParser

        protected UriTemplate.UriTemplateParser createParser​(java.lang.String templateString,
                                                             java.lang.Object... parserArguments)
        Description copied from class: UriTemplate
        Creates a parser.
        Overrides:
        createParser in class UriTemplate
        Parameters:
        templateString - The template
        parserArguments - The parsed arguments
        Returns:
        The created parser