com.townleyenterprises.filter
Class SubstringFilter

java.lang.Object
  extended bycom.townleyenterprises.common.PropertyProxy
      extended bycom.townleyenterprises.filter.QueryFilter
          extended bycom.townleyenterprises.filter.StringFilter
              extended bycom.townleyenterprises.filter.SubstringFilter
All Implemented Interfaces:
Filter, java.io.Serializable

public class SubstringFilter
extends StringFilter

This class extends StringFilter to allow substring checks to determine if the value is contained in the value of the object to which it is applied. It supports both case sensitive and case insensitive searching.

Since:
2.0
Version:
$Id: SubstringFilter.java,v 1.4 2004/07/28 10:33:58 atownley Exp $
Author:
Andrew S. Townley
See Also:
Serialized Form

Constructor Summary
SubstringFilter(java.lang.Class klass, java.lang.String property, java.lang.String value)
          The constructor takes the property and the string value which should be compared.
SubstringFilter(java.lang.Class klass, java.lang.String property, java.lang.String value, boolean ignorecase)
          The constructor takes the property and the string value which should be compared.
 
Method Summary
 boolean doFilter(java.lang.Object o)
          This method actually performs the operation that will determine if the parameter object should be included in the "result" or not.
protected  java.lang.String getOperatorString()
          This method may be overridden by custom query filter instances to return a string which describes the test they are performing if it is not one of the standard operators.
 
Methods inherited from class com.townleyenterprises.filter.StringFilter
getIgnoreCase
 
Methods inherited from class com.townleyenterprises.filter.QueryFilter
getOperator, getProperty, getValue, toString
 
Methods inherited from class com.townleyenterprises.common.PropertyProxy
getPropertyValue, getSubjectClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubstringFilter

public SubstringFilter(java.lang.Class klass,
                       java.lang.String property,
                       java.lang.String value)
The constructor takes the property and the string value which should be compared. Using this constructor will result in case sensitive comparisons.

Parameters:
klass - the class of the object to be filtered
property - the property name
value - the string value

SubstringFilter

public SubstringFilter(java.lang.Class klass,
                       java.lang.String property,
                       java.lang.String value,
                       boolean ignorecase)
The constructor takes the property and the string value which should be compared.

Parameters:
klass - the class of the object to be filtered
property - the property name
value - the string value
ignorecase - controls search case sensitivity
Method Detail

doFilter

public boolean doFilter(java.lang.Object o)
Description copied from interface: Filter
This method actually performs the operation that will determine if the parameter object should be included in the "result" or not.

Specified by:
doFilter in interface Filter
Overrides:
doFilter in class StringFilter

getOperatorString

protected java.lang.String getOperatorString()
Description copied from class: QueryFilter
This method may be overridden by custom query filter instances to return a string which describes the test they are performing if it is not one of the standard operators.

Overrides:
getOperatorString in class QueryFilter
Returns:
the operator string


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.