butler.sql.query
Class Filter

java.lang.Object
  extended bybutler.sql.query.Filter
Direct Known Subclasses:
Eq, ForeignKeyFilter, IsNullFilter, JoinFilter, MultipleColumnFilter, MultipleColumnFilter, PrimaryKeyFilter, QBEFilter, QBEFilter, RangeFilter, RecursiveFilter, ScrollFilter, SetFilter, SimpleFilter, SQLFilter

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
 Filter copy()
           
 boolean equals(Filter other)
           
 java.lang.String getCaption()
           
 Filter getFilter(java.lang.Object id)
          Returns a registered filter.
 java.util.Map getFilterMap()
           
 java.lang.Object getId()
           
 java.util.List getLeafFilters()
           
 Query getNestedQuery()
           
 Operator getOperator()
          Returns operator if operators is used, otherwise returning null.
 java.lang.String getSQL()
           
 java.lang.String getSQL(Query.SQLBuilder callback)
           
 java.util.List getValues()
           
 int hashCode()
           
 Filter modify(QueryParams params)
           
 java.util.List params2db(java.util.List params)
           
static Filter parseFilter(org.dom4j.Element element, java.util.Map tableDictonary, Filter rootQ)
           
 void registerFilter(java.lang.Object id, Filter filter)
          Registers a filter with a given id.
 void replaceFilter(Filter newFilter)
           
 void setId(java.lang.Object id)
           
 void setOperator(Operator op)
          Sets the operator if operators is used, otherwise throws an exeption
 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

getSQL

public java.lang.String getSQL(Query.SQLBuilder callback)
                        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

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

hashCode

public int hashCode()

equals

public boolean equals(Filter other)

parseFilter

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

getFilter

public Filter getFilter(java.lang.Object id)
Returns a registered filter.


getFilterMap

public java.util.Map getFilterMap()

getLeafFilters

public java.util.List getLeafFilters()

registerFilter

public void registerFilter(java.lang.Object id,
                           Filter filter)
Registers a filter with a given id. This id can be used for parameter population.


replaceFilter

public void replaceFilter(Filter newFilter)
                   throws java.lang.Exception
Throws:
java.lang.Exception

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, otherwise throws an exeption


getValues

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

copy

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

modify

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