public final class SimpleUrlPattern extends Object implements UrlPattern
*
or ?
wildcards.UrlPattern.MatchAllPattern
Modifier and Type | Field and Description |
---|---|
static String |
MULTIPLE_CHAR_PATTERN
Regexp pattern used for the simple keyword
* . |
static String |
SINGLE_CHAR_PATTERN
Regexp pattern used for the simple keyword
? . |
static String |
URL_CHAR_PATTERN
Deprecated.
URL_CHAR_PATTERN used to be a common prefix for both single/multiple-characters wildcard patterns—
before 4.3.1, it used to be a complex white-listing regex. Standalone, it is however of no use.
|
MATCH_ALL
Constructor and Description |
---|
SimpleUrlPattern()
Default constructor used by ContentToBean.
|
SimpleUrlPattern(String string)
Compile a regexp pattern handling
* and ? chars. |
Modifier and Type | Method and Description |
---|---|
static String |
getEncodedString(String str)
Replace all "*" with
RegexWildcardPattern.MULTIPLE_CHAR_PATTERN . |
int |
getLength()
Returns the pattern length.
|
String |
getPatternString()
Returns the pattern string.
|
boolean |
match(String str)
Does the patter match the given url?
|
void |
setPatternString(String patternString)
Mainly used by ContentToBean.
|
String |
toString() |
@Deprecated public static final String URL_CHAR_PATTERN
public static final String MULTIPLE_CHAR_PATTERN
*
. Matches 0 or more characters.public static final String SINGLE_CHAR_PATTERN
?
. Matches 0 or 1 character.public SimpleUrlPattern()
public SimpleUrlPattern(String string)
*
and ?
chars.string
- input stringpublic static String getEncodedString(String str)
RegexWildcardPattern.MULTIPLE_CHAR_PATTERN
.str
- input string*
and ?
are replaced with a regexp
pattern.public boolean match(String str)
UrlPattern
match
in interface UrlPattern
str
- url to matchtrue
if the given URL matches the patternpublic int getLength()
UrlPattern
getLength
in interface UrlPattern
public String getPatternString()
UrlPattern
getPatternString
in interface UrlPattern
public void setPatternString(String patternString)
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.