|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.securityfilter.filter.URLPattern
URLPattern - Contains matchable URL pattern and the associated SecurityConstraint and WebResourceCollection objects for the pattern. Also supports sorting according to the Servlet Spec v2.3.
| Field Summary | |
protected org.apache.oro.text.regex.Pattern |
compiledPattern
|
protected SecurityConstraint |
constraint
|
protected String |
convertedPattern
|
static int |
DEFAULT_TYPE
Pattern type for EXTENSION_TYPE mappings. |
static int |
EXACT_TYPE
Pattern type for patterns that do not meet the specifications for the other pattern types. |
static int |
EXTENSION_TYPE
Pattern type for EXTENSION_TYPE mappings. |
protected int |
order
|
static int |
PATH_TYPE
Pattern type for PATH_TYPE mappings. |
protected int |
pathLength
|
protected String |
pattern
|
protected int |
patternType
|
protected WebResourceCollection |
resourceCollection
|
| Constructor Summary | |
URLPattern(String pattern,
SecurityConstraint constraint,
WebResourceCollection resourceCollection,
int order,
org.apache.oro.text.regex.PatternCompiler compiler)
Construct a new URLPattern object. |
|
| Method Summary | |
int |
compareTo(Object obj)
Compares this URLPattern to obj to support sorting. |
boolean |
equals(Object obj)
Test if this pattern is equivalent to another pattern. |
org.apache.oro.text.regex.Pattern |
getCompiledPattern()
Get the compiled version of this pattern. |
int |
getOrder()
Get the order value for this pattern (the order in which it appeared in the config file). |
int |
getPathLength()
Get the path length of the pattern. |
String |
getPattern()
Get the url pattern to match. |
int |
getPatternType()
Get the pattern type. |
SecurityConstraint |
getSecurityConstraint()
Get the SecurityConstraint object associated with this pattern. |
WebResourceCollection |
getWebResourceCollection()
Get the WebResourceCollection associated with this pattern. |
protected void |
initCompiledPattern(org.apache.oro.text.regex.PatternCompiler compiler)
Initialize the compiledPattern protected member. |
protected void |
initConvertedPattern()
Initialize the convertedPattern protected member. |
protected void |
initPathLength()
Initialize the pathLength protected member. |
protected void |
initPatternType()
Initialize the patternType protected member. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int EXACT_TYPE
public static final int PATH_TYPE
public static final int EXTENSION_TYPE
public static final int DEFAULT_TYPE
protected String pattern
protected String convertedPattern
protected org.apache.oro.text.regex.Pattern compiledPattern
protected SecurityConstraint constraint
protected WebResourceCollection resourceCollection
protected int order
protected int patternType
protected int pathLength
| Constructor Detail |
public URLPattern(String pattern,
SecurityConstraint constraint,
WebResourceCollection resourceCollection,
int order,
org.apache.oro.text.regex.PatternCompiler compiler)
throws Exception
pattern - the url pattern to matchconstraint - the SecurityConstraint associated with this patternresourceCollection - the WebResourceCollection associated with this patternorder - the order in which this pattern occurred in the configuration filecompiler - a PatternCompiler to use to compile this url patternURLPatternFactory| Method Detail |
public String getPattern()
public org.apache.oro.text.regex.Pattern getCompiledPattern()
public int getPatternType()
public int getPathLength()
Examples:
public SecurityConstraint getSecurityConstraint()
public int getOrder()
public WebResourceCollection getWebResourceCollection()
protected void initPatternType()
protected void initPathLength()
protected void initConvertedPattern()
protected void initCompiledPattern(org.apache.oro.text.regex.PatternCompiler compiler)
throws Exception
compiler -
Exceptionpublic boolean equals(Object obj)
obj - the value to test equivalence with
public int compareTo(Object obj)
throws ClassCastException
The sort order is dictated by the servlet spec. The ordering by type is: EXACT_TYPE PATH_TYPE EXTENTION_TYPE DEFAULT_TYPE Ordering among PATH_TYPE patterns is determined by path length, with the longer path coming first. If the path lengths are the same, or both patterns are of the same type other than PATH_TYPE, ordering is determined by the order in which the pattern appeared in the config file. Thanks to Chris Nokleberg for contributing code for this method.
compareTo in interface Comparableobj - another URLPattern to compare to
ClassCastException - thrown if obj is not a URLPattern instance
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||