/** * Match a URI against the pattern. * * @param uri the uri to match against the template. * @return the match result, otherwise null if no match occurs. */ public final MatchResult match(CharSequence uri) { // Check for match against the empty pattern if (uri == null || uri.length() == 0) return (regexPattern == null) ? EMPTY_STRING_MATCH_RESULT : null; else if (regexPattern == null) return null; // Match the URI to the URI template regular expression Matcher m = regexPattern.matcher(uri); if (!m.matches()) return null; return (groupIndexes.length > 0) ? new GroupIndexMatchResult(m) : m; }
public String group(int group) { if (group > groupCount()) throw new IndexOutOfBoundsException(); return (group > 0) ? r.group(groupIndexes[group - 1]) : r.group(); }
/** * Match a URI against the pattern. * * @param uri the uri to match against the template. * @return the match result, otherwise null if no match occurs. */ public final MatchResult match(CharSequence uri) { // Check for match against the empty pattern if (uri == null || uri.length() == 0) return (regexPattern == null) ? EMPTY_STRING_MATCH_RESULT : null; else if (regexPattern == null) return null; // Match the URI to the URI template regular expression Matcher m = regexPattern.matcher(uri); if (!m.matches()) return null; return (groupIndexes.length > 0) ? new GroupIndexMatchResult(m) : m; }
public String group(int group) { if (group > groupCount()) throw new IndexOutOfBoundsException(); return (group > 0) ? r.group(groupIndexes[group - 1]) : r.group(); }
public int end(int group) { if (group > groupCount()) throw new IndexOutOfBoundsException(); return (group > 0) ? r.end(groupIndexes[group - 1]) : r.end(); }
public int end(int group) { if (group > groupCount()) throw new IndexOutOfBoundsException(); return (group > 0) ? r.end(groupIndexes[group - 1]) : r.end(); }
public int start(int group) { if (group > groupCount()) throw new IndexOutOfBoundsException(); return (group > 0) ? r.start(groupIndexes[group - 1]) : r.start(); }
public int start(int group) { if (group > groupCount()) throw new IndexOutOfBoundsException(); return (group > 0) ? r.start(groupIndexes[group - 1]) : r.start(); }