Package com.google.gwt.util.regexfilter
Class RegexFilter
- java.lang.Object
-
- com.google.gwt.util.regexfilter.RegexFilter
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
WhitelistRegexFilter
public abstract class RegexFilter extends java.lang.Object implements java.io.Serializable
This class implements filters that are configured with a sequence of regexes. Each regex in the sequence can be preceded by a + or a - to indicate whether it indicates that queries matching the regex should be included or excluded. Concrete subclasses indicate the default behaviors by overridingacceptByDefault()
andentriesArePositiveByDefault()
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RegexFilter()
RegexFilter(TreeLogger logger, java.util.List<java.lang.String> values)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
acceptByDefault()
If no pattern matches, whether the query should be considered as an accept.void
add(java.lang.String regex)
void
addAll(RegexFilter regexFilter)
void
addAll(java.util.List<java.lang.String> newValues)
protected abstract boolean
entriesArePositiveByDefault()
If a pattern is not preceded by + or -, whether the query should be considered positive.java.util.List<java.lang.String>
getValues()
boolean
isEmpty()
boolean
isIncluded(TreeLogger logger, java.lang.String query)
boolean
isIncluded(java.lang.String query)
-
-
-
Constructor Detail
-
RegexFilter
public RegexFilter()
-
RegexFilter
public RegexFilter(TreeLogger logger, java.util.List<java.lang.String> values) throws UnableToCompleteException
- Throws:
UnableToCompleteException
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
getValues
public java.util.List<java.lang.String> getValues()
-
add
public void add(java.lang.String regex)
-
addAll
public void addAll(java.util.List<java.lang.String> newValues)
-
addAll
public void addAll(RegexFilter regexFilter)
-
isIncluded
public boolean isIncluded(java.lang.String query)
-
isIncluded
public boolean isIncluded(TreeLogger logger, java.lang.String query)
-
acceptByDefault
protected abstract boolean acceptByDefault()
If no pattern matches, whether the query should be considered as an accept.
-
entriesArePositiveByDefault
protected abstract boolean entriesArePositiveByDefault()
If a pattern is not preceded by + or -, whether the query should be considered positive.
-
-