public interface Filter
The default implementation is in DefaultFilter
.
A simple "Never-Filter" whould look like:
/* * * The simplest default implementation doesn't filter. * / public static final Filter NO_FILTER = new Filter() { public void addExclude(final String pattern) { throw new java.lang.IllegalStateException("This instance of Filter cannot be modified."); } public void addInclude(final String pattern) { throw new java.lang.IllegalStateException("This instance of Filter cannot be modified."); } public boolean isValid(final String key) { return true; } };
Modifier and Type | Method and Description |
---|---|
void |
addExclude(String pattern)
Add an exclude Pattern (Which pattern-Syntax is determinate by the implementation).
|
void |
addInclude(String pattern)
Add an include Pattern (Which pattern-Syntax is determinate by the implementation).
|
boolean |
isValid(String key)
Return true if the key is not filtered out.
|
void addInclude(String pattern)
pattern
- the pattern.void addExclude(String pattern)
pattern
- the pattern.boolean isValid(String key)
key
- The key to check.Copyright © 2008–2014. All rights reserved.