Class UrlPatternMatcher
- java.lang.Object
-
- io.quarkiverse.openapi.generator.providers.UrlPatternMatcher
-
public class UrlPatternMatcher extends Object
PathPatternMatcher leverages Regex Pattern to represent a parameterized URL. Parameters within the URL are denoted by curly braces '{}' with the parameter name contained within (e.g. '{userid}').- /api/search.{format}
- /api/search/users/{userid}.{format}
- /api/{version}/search/users/{userid}
RestExpress parses URI paths which is described in the URI Generic Syntax IETF RFC 3986 specification, section 3.3 (http://tools.ietf.org/html/rfc3986#section-3.3). RestExpress parses paths into segments separated by slashes ("/"), the segments of which are composed of unreserved, percent encoded, sub-delimiters, colon (":") or ampersand ("@"), each of which are defined below (from the spec):
pct-encoded = "%" HEXDIG HEXDIG unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
reserved = gen-delims / sub-delims
gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" * In other words, RestExpress accepts path segments containing: [A-Z] [a-z] [0-9] % - . _ ~ ! $ & ' ( ) * + , ; = : @ RestExpress also accepts square brackets ('[' and ']'), but this is deprecated and not recommended.- Since:
- Apr 28, 2010
- Author:
- toddf
- See Also:
- http://www.ietf.org/rfc/rfc3986.txt
-
-
Constructor Summary
Constructors Constructor Description UrlPatternMatcher(String pattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(String url)
Test the given URL against the underlying pattern to determine if it matches, returning a boolean to reflect the outcome.
-
-
-
Constructor Detail
-
UrlPatternMatcher
public UrlPatternMatcher(String pattern)
- Parameters:
pattern
-
-
-
Method Detail
-
matches
public boolean matches(String url)
Test the given URL against the underlying pattern to determine if it matches, returning a boolean to reflect the outcome.- Parameters:
url
- an URL string with or without query string.- Returns:
- true if the given URL matches the underlying pattern. Otherwise false.
-
-