com.jidesoft.filter
Class LikeFilter<T>
java.lang.Object
com.jidesoft.filter.AbstractFilter<T>
com.jidesoft.filter.RegexFilter<T>
com.jidesoft.filter.LikeFilter<T>
- All Implemented Interfaces:
- Filter<T>, ObjectGrouperSupport, SqlFilterSupport, Serializable, Cloneable
- Direct Known Subclasses:
- NotLikeFilter
public class LikeFilter<T>
- extends RegexFilter<T>
- implements SqlFilterSupport
A filter implements filtering a string based the LIKE condition as in SQL. The pattern is specified in the
constructor. The patterns that you can choose from are: '%' allows you to match any string of any length (including
zero length) and '_' allows you to match on a single character.
Please note, in Oracle, the SQL supports defining escape character but this is not supported in this LikeFilter.
However if you need, you can override convertFromPatternToRegex to convert your own regular expression based on the
input pattern.
- See Also:
- Serialized Form
Methods inherited from class com.jidesoft.filter.RegexFilter |
convertElementToString, createRegexPattern, getPattern, getPreference, isBeginWith, isCaseSensitive, isEndWith, isValueFiltered, setBeginWith, setCaseSensitive, setEndWith, setPattern, setPreference, stricterThan |
Methods inherited from class com.jidesoft.filter.AbstractFilter |
addFilterListener, clone, fireFilterChanged, fireFilterContentChanged, fireFilterDisabled, fireFilterEnabled, fireFilterNameChanged, getConditionString, getFilterFactory, getFilterFactoryName, getFilterListeners, getName, getObjectGrouper, getObjectGrouperName, isEnabled, isFilterValid, removeFilterListener, setEnabled, setFilterFactory, setFilterFactoryName, setName, setObjectGrouper, setObjectGrouperName |
LikeFilter
public LikeFilter()
LikeFilter
public LikeFilter(String pattern)
convertFromPatternToRegex
protected String convertFromPatternToRegex(String pattern)
- Converts the SQL Like compatible pattern to the pattern used in Java Pattern class.
- Overrides:
convertFromPatternToRegex
in class RegexFilter<T>
- Parameters:
pattern
- the input pattern.
- Returns:
- the pattern string used by
Pattern
.
getOperator
public String getOperator()
- Gets the operator. It will return " LIKE " by default.
- Specified by:
getOperator
in interface SqlFilterSupport
- Returns:
- the operator.
equals
public boolean equals(Object obj)
- Overrides:
equals
in class RegexFilter<T>