public class URIPattern extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
HOST |
static String |
PASSWORD |
static String |
PORT |
static String |
SCHEME |
static String |
USERNAME |
| Constructor and Description |
|---|
URIPattern(String uri) |
URIPattern(URI uri) |
| Modifier and Type | Method and Description |
|---|---|
URI |
construct(Map<String,String> options)
Constructs a
URI that matches this pattern from the given options. |
boolean |
equals(Object o) |
Map<String,String> |
getLastMatch()
Returns the parsed results of the last matched URI.
|
Map<String,String> |
getMatch(String uri)
Returns results from parsing a
URI with this pattern. |
Map<String,String> |
getMatch(URI uri)
Returns results from parsing a
URI with this pattern. |
String |
getPatternString() |
String |
getScheme() |
int |
hashCode() |
boolean |
matches(String uri)
Returns true if the
URI String matches this pattern. |
boolean |
matches(URI uri)
Returns true if the
URI matches this pattern. |
String |
toString() |
public static final String SCHEME
public static final String HOST
public static final String PORT
public static final String USERNAME
public static final String PASSWORD
public String getScheme()
public String getPatternString()
public URI construct(Map<String,String> options)
URI that matches this pattern from the given options.options - a map of variable andURI that matches this patternIllegalArgumentException - if the URI cannot be constructedpublic boolean matches(URI uri)
URI matches this pattern.
If successful, the variable values are available by calling
getLastMatch() (not thread safe).uri - a String to check against this pattern.public boolean matches(String uri) throws URISyntaxException
URI String matches this pattern.
If successful, the variable values are available by calling
getLastMatch() (not thread safe).uri - a String to check against this pattern.URISyntaxException - if the String is not a valid URIpublic Map<String,String> getMatch(URI uri)
URI with this pattern.
If the URI doesn't match the pattern, this will return null.uri - A URI to match against this URIPatternpublic Map<String,String> getMatch(String uri) throws URISyntaxException
URI with this pattern.
If the URI doesn't match the pattern, this will return null.uri - A URI to match against this URIPatternURISyntaxException - if the String is not a valid URIpublic Map<String,String> getLastMatch()
Copyright © 2013–2015. All rights reserved.