|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.util.SimpleUrlPattern
public final class SimpleUrlPattern
An implementation of URLPattern which matches strings using simple *
or ?
wildcards.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface info.magnolia.cms.util.UrlPattern |
---|
UrlPattern.MatchAllPattern |
Field Summary | |
---|---|
static java.lang.String |
MULTIPLE_CHAR_PATTERN
Regexp pattern used for the simple keyword * . |
static java.lang.String |
SINGLE_CHAR_PATTERN
Regexp pattern used for the simple keyword ? . |
static java.lang.String |
URL_CHAR_PATTERN
Any char, newline included. |
Fields inherited from interface info.magnolia.cms.util.UrlPattern |
---|
MATCH_ALL |
Constructor Summary | |
---|---|
SimpleUrlPattern(java.lang.String string)
Compile a regexp pattern handling * and ? chars. |
Method Summary | |
---|---|
static java.lang.String |
getEncodedString(java.lang.String str)
Replace all "*" with RegexWildcardPattern.MULTIPLE_CHAR_PATTERN . |
int |
getLength()
Returns the pattern length. |
boolean |
match(java.lang.String str)
Does the patter match the given url? |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String URL_CHAR_PATTERN
public static final java.lang.String MULTIPLE_CHAR_PATTERN
*
. Matches 0 or more characters.
public static final java.lang.String SINGLE_CHAR_PATTERN
?
. Matches 0 or 1 character.
Constructor Detail |
---|
public SimpleUrlPattern(java.lang.String string)
*
and ?
chars.
string
- input stringMethod Detail |
---|
public static java.lang.String getEncodedString(java.lang.String str)
RegexWildcardPattern.MULTIPLE_CHAR_PATTERN
.
str
- input string
*
and ?
are replaced with a regexp
pattern.public boolean match(java.lang.String str)
UrlPattern
match
in interface UrlPattern
str
- url to match
true
if the given URL matches the patternUrlPattern.match(java.lang.String)
public int getLength()
UrlPattern
getLength
in interface UrlPattern
UrlPattern.getLength()
public 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 |