|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.uri.PatternWithGroups
public class PatternWithGroups
A pattern for matching a string against a regular expression and returning capturing group values for any capturing groups present in the expression.
#renamed com.sun.jersey.api.uri.UriPattern
| Field Summary | |
|---|---|
static PatternWithGroups |
EMPTY
The empty pattern that matches the null or empty string. |
| Constructor Summary | |
|---|---|
protected |
PatternWithGroups()
Construct an empty pattern. |
|
PatternWithGroups(Pattern regexPattern)
Construct a new pattern. |
|
PatternWithGroups(Pattern regexPattern,
int[] groupIndexes)
Construct a new pattern. |
|
PatternWithGroups(String regex)
Construct a new pattern. |
|
PatternWithGroups(String regex,
int[] groupIndexes)
Construct a new pattern. |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
int[] |
getGroupIndexes()
Get the group indexes. |
String |
getRegex()
Get the regular expression. |
int |
hashCode()
|
MatchResult |
match(CharSequence cs)
Match against the pattern. |
boolean |
match(CharSequence cs,
List<String> groupValues)
Match against the pattern. |
boolean |
match(CharSequence cs,
List<String> groupNames,
Map<String,String> groupValues)
Match against the pattern. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final PatternWithGroups EMPTY
| Constructor Detail |
|---|
protected PatternWithGroups()
public PatternWithGroups(String regex)
throws PatternSyntaxException
regex - the regular expression. If the expression is null or an empty string then the pattern will only match
a null or empty string.
PatternSyntaxException - if the regular expression could not be compiled.
public PatternWithGroups(String regex,
int[] groupIndexes)
throws PatternSyntaxException
regex - the regular expression. If the expression is null or an empty string then the pattern will only match
a null or empty string.groupIndexes - the array of group indexes to capturing groups.
PatternSyntaxException - if the regular expression could not be compiled.
public PatternWithGroups(Pattern regexPattern)
throws IllegalArgumentException
regexPattern - the regular expression pattern.
IllegalArgumentException - if the regexPattern is null.
public PatternWithGroups(Pattern regexPattern,
int[] groupIndexes)
throws IllegalArgumentException
regexPattern - the regular expression pattern.groupIndexes - the array of group indexes to capturing groups.
IllegalArgumentException - if the regexPattern is null.| Method Detail |
|---|
public final String getRegex()
public final int[] getGroupIndexes()
public final MatchResult match(CharSequence cs)
cs - the char sequence to match against the template.
public final boolean match(CharSequence cs,
List<String> groupValues)
throws IllegalArgumentException
cs - the char sequence 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.
true if the char sequence matches the pattern, otherwise false.
IllegalArgumentException - if the group values is null.
public final boolean match(CharSequence cs,
List<String> groupNames,
Map<String,String> groupValues)
throws IllegalArgumentException
cs - the char sequence 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.
true if the matches the pattern, otherwise false.
IllegalArgumentException - if group values is null.public final int hashCode()
hashCode in class Objectpublic final boolean equals(Object obj)
equals in class Objectpublic final String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||