Interface URIPattern


public interface URIPattern

A URI pattern is used to create a URI matcher to perform match operation on URI against against a regular expression built from a URI Builder's components.

A URI pattern is created from a URI builder by invoking the builder's buildPattern or buildPathPattern methods. It is then used to create URI matchers that performs match operations on an input URI string.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Describes the inclusion state of a URI pattern in another URI pattern.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the underlying JDK pattern.
    Return the URI regular expression.
    Returns the raw value of the pattern.
    Determines whether the set of URIs matched by the specified URI pattern is included in the set of URIs matched by this URI pattern.
    Creates a matchers that will match the specified input URI against this pattern.
  • Method Details

    • getPattern

      Pattern getPattern()

      Return the underlying JDK pattern.

      Returns:
      a pattern
    • getPatternString

      String getPatternString()

      Return the URI regular expression.

      Returns:
      a regular expression
    • getValue

      String getValue()

      Returns the raw value of the pattern.

      Returns:
      the pattern's raw value
    • matcher

      URIMatcher matcher(String uri)

      Creates a matchers that will match the specified input URI against this pattern.

      Parameters:
      uri - The URI to match
      Returns:
      a URI matcher
    • includes

      URIPattern.Inclusion includes(URIPattern pattern)

      Determines whether the set of URIs matched by the specified URI pattern is included in the set of URIs matched by this URI pattern.

      Considering A: the set of URIs matched by the specified URI pattern, and B: the set of URIs matched by this URI pattern, this method should return:

      Implementations can choose to focus on specific URI components such as path in which case this method must return URIPattern.Inclusion.INDETERMINATE when other components are considered. Parameter names must also be ignored by implementations (eg. /{x} should be considered as equivalent to /{y}).

      Parameters:
      pattern - a URI pattern
      Returns:
      a pattern inclusion state specifying whether the specified pattern is included in this pattern