|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.api.uri.UriPattern
public class UriPattern
A URI pattern for matching a URI against a regular expression and returning capturing group values for any capturing groups present in the expression.
Field Summary | |
---|---|
static UriPattern |
EMPTY
The empty URI pattern that matches the null or empty URI path |
Constructor Summary | |
---|---|
UriPattern(java.lang.String regex)
Construct a new URI pattern. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getRegex()
Get the regular expression. |
int |
hashCode()
|
boolean |
match(java.lang.CharSequence uri,
java.util.List<java.lang.String> groupValues)
Match a URI against the pattern. |
boolean |
match(java.lang.CharSequence uri,
java.util.List<java.lang.String> groupNames,
java.util.Map<java.lang.String,java.lang.String> groupValues)
Match a URI against the pattern. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final UriPattern EMPTY
Constructor Detail |
---|
public UriPattern(java.lang.String regex)
regex
- the regular expression. If the expression is null or an
empty string then the pattern will only match a null or empty
URI path.
{@link
- java.util.regex.PatternSyntaxException} if the specific
regular expression could not be generatedMethod Detail |
---|
public final java.lang.String getRegex()
public final boolean match(java.lang.CharSequence uri, java.util.List<java.lang.String> groupValues)
If the URI matches against the pattern then the capturing group values (if any) will be added to a list passed in as parameter.
uri
- the uri to match against the template.groupValues
- the list to add the values of a pattern's
capturing groups if matching is successful. The values are added
in the same order as the pattern's capturing groups. The list
is cleared before values are added.
{@link
- IllegalArgumentException} if the uri or
capturingGroupValues is null.public final boolean match(java.lang.CharSequence uri, java.util.List<java.lang.String> groupNames, java.util.Map<java.lang.String,java.lang.String> groupValues)
If the URI matches against the pattern then the capturing group values (if any) will be added to a map passed in as parameter.
uri
- the uri to match against the template.groupNames
- the list names associated with a pattern's
capturing groups. The names MUST be in the same order as the
pattern's capturing groups and the size MUST be equal to or
less than the number of capturing groups.groupValues
- the map to add the values of a pattern's
capturing groups if matching is successful. A values is put
into the map using the group name associated with the
capturing group. The map is cleared before values are added.
{@link
- IllegalArgumentException} if the uri or
capturingGroupValues is null.public final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |