|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.urlfilter.AIncludeExcludeFilter
Provides a basic frame for file/url filtering. The real benefit is the simple central model of configuration.
Constructor Summary | |
AIncludeExcludeFilter()
|
Method Summary | |
void |
addExclude(Object exclude)
Adds a string pattern to the list of patterns to exclude. |
void |
addInclude(Object include)
Adds a string pattern to the list of patterns to include. |
protected List |
getExcludes()
Returns the list of include patterns |
protected List |
getIncludes()
Returns the list of include patterns |
void |
init(Element configNode)
Initializes this SimpleURLFilter with a JDOM element that has an include and exclude pattern list. |
protected abstract boolean |
matchAny(List patternList,
String name)
Returns true if url matches any of the patterns in the list. |
boolean |
matchExcludes(String name)
Returns true if any in the includes list is matched |
boolean |
matchIncludes(String name)
Returns true if any in the includes list is matched |
String |
toString()
Returns a meaningful string representation of this filter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AIncludeExcludeFilter()
Method Detail |
public void addInclude(Object include)
public void addExclude(Object exclude)
protected List getIncludes()
protected List getExcludes()
public void init(Element configNode)
<filters>
<includes>
<include pattern="" />
<include pattern="" />
</includes>
<excludes>
<exclude pattern="" />
<exclude pattern="" />
</excludes>
</filters>
Both includes and excludes are required, or a RuntimeException
will be thrown.
RuntimeException
- When the includes or excludes section is missingpublic String toString()
public boolean matchIncludes(String name)
public boolean matchExcludes(String name)
protected abstract boolean matchAny(List patternList, String name)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |