butler.sql.filter
Class Filter

java.lang.Object
  extended by butler.sql.filter.Filter
Direct Known Subclasses:
BooleanFilter, DummyFilter, ForeignKeyFilter, IsNullFilter, JoinFilter, MultipleColumnFilter, PrimaryKeyFilter, QBEFilter, RangeFilter, RecursiveFilter, ScrollFilter, SecurityFilter, SetFilter, SimpleFilter, SQLFilter, TemporalFilter

public class Filter
extends java.lang.Object

Filter used in database queries. A filter represents entire or part of the where-clause in a select SQL statement.

Author:
Fredrik Bertilsson

Constructor Summary
Filter()
           
Filter(java.lang.String id)
           
 
Method Summary
 AndFilter and(Filter filter)
           
 Filter copy()
           
 int createId(int lastId)
           
 boolean equals(Filter other)
           
 boolean filter(Record rec)
           
 java.lang.String getCaption()
           
 Filter getFilter(java.lang.Object id)
           
 java.lang.Object getId()
           
 java.util.List getLeafFilters()
           
 Query getNestedQuery()
           
 Operator getOperator()
          Returns operator if operators is used, otherwise returning null.
 java.util.List getParamDatatypes()
           
 java.lang.String getSQL()
           
 java.util.List getValues()
           
 java.util.List getValues(QueryParams params)
           
 int hashCode()
           
 Filter modify(QueryParams params)
           
 NotFilter not()
           
 OrFilter or(Filter filter)
           
 java.util.List params2db(java.util.List params)
           
static Filter parseFilter(org.dom4j.Element element, java.util.Map tableDictonary)
           
static void registerFilterParser(java.lang.String filterName, FilterParser parser)
           
 void setCaption(java.lang.String caption)
           
 void setId(java.lang.Object id)
           
 void setOperator(Operator op)
          Sets the operator if operators is used
 int setSize()
           
 void setSize(int size)
           
 java.lang.String toXML()
           
 void toXML(org.xml.sax.ContentHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter()

Filter

public Filter(java.lang.String id)
Method Detail

setSize

public void setSize(int size)

setSize

public int setSize()

getNestedQuery

public Query getNestedQuery()

getSQL

public java.lang.String getSQL()
                        throws java.lang.Exception
Throws:
java.lang.Exception

setId

public void setId(java.lang.Object id)

getId

public java.lang.Object getId()

getCaption

public java.lang.String getCaption()
                            throws java.lang.Exception
Throws:
java.lang.Exception

setCaption

public void setCaption(java.lang.String caption)

params2db

public java.util.List params2db(java.util.List params)
                         throws java.lang.Exception
Throws:
java.lang.Exception

toXML

public java.lang.String toXML()
                       throws java.lang.Exception
Throws:
java.lang.Exception

toXML

public void toXML(org.xml.sax.ContentHandler handler)
           throws java.lang.Exception
Throws:
java.lang.Exception

equals

public boolean equals(Filter other)

parseFilter

public static Filter parseFilter(org.dom4j.Element element,
                                 java.util.Map tableDictonary)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getLeafFilters

public java.util.List getLeafFilters()

getOperator

public Operator getOperator()
Returns operator if operators is used, otherwise returning null.


setOperator

public void setOperator(Operator op)
Sets the operator if operators is used


getValues

public java.util.List getValues()
                         throws java.lang.Exception
Throws:
java.lang.Exception

getValues

public java.util.List getValues(QueryParams params)
                         throws java.lang.Exception
Throws:
java.lang.Exception

copy

public Filter copy()
            throws java.lang.Exception
Throws:
java.lang.Exception

registerFilterParser

public static void registerFilterParser(java.lang.String filterName,
                                        FilterParser parser)

modify

public Filter modify(QueryParams params)
              throws java.lang.Exception
Throws:
java.lang.Exception

filter

public boolean filter(Record rec)
               throws java.lang.Exception
Throws:
java.lang.Exception

and

public AndFilter and(Filter filter)
              throws java.lang.Exception
Throws:
java.lang.Exception

or

public OrFilter or(Filter filter)
            throws java.lang.Exception
Throws:
java.lang.Exception

not

public NotFilter not()
              throws java.lang.Exception
Throws:
java.lang.Exception

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getFilter

public Filter getFilter(java.lang.Object id)

getParamDatatypes

public java.util.List getParamDatatypes()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

createId

public int createId(int lastId)