All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.xmldbms.filters.FilterConditions

java.lang.Object
   |
   +----org.xmlmiddleware.xmldbms.filters.FilterConditions

public class FilterConditions
extends Object
Container for the WHERE clause conditions of a filter. For internal use.

Version:
2.0
Author:
Ronald Bourret, 2001

Method Index

 o addCondition(String)
Add a condition to the end of the list.
 o getColumns()
Get a list of Column objects corresponding to the parameters.
 o getCondition(int)
Get a specific condition.
 o getConditions()
Get the conditions.
 o getParameterValues()
Get a list of parameter values.
 o getTable()
Get the table to which the filter conditions apply.
 o getWhereCondition()
Get the condition that can be appended to the WHERE clause.
 o removeAllConditions()
Remove all wrapper conditions.
 o removeCondition(int)
Remove the specified condition.
 o setParameters(Hashtable)
Set the parameters to be used with the conditions.

Methods

 o getTable
 public final Table getTable()
Get the table to which the filter conditions apply.

Returns:
The table.
 o getCondition
 public final String getCondition(int index)
Get a specific condition.

Parameters:
index - The index of the condition. 0-based.
Returns:
The condition
 o getConditions
 public Vector getConditions()
Get the conditions.

Returns:
A Vector containing the conditions as Strings.
 o addCondition
 public void addCondition(String condition)
Add a condition to the end of the list.

Parameters:
condition - The condition
 o removeCondition
 public void removeCondition(int index) throws XMLMiddlewareException
Remove the specified condition.

This method shifts conditions at or above the specified index downward one position.

Parameters:
index - Index of the condition. 0-based.
Throws: XMLMiddlewareException
Thrown if the index is invalid.
 o removeAllConditions
 public void removeAllConditions()
Remove all wrapper conditions.

 o setParameters
 public void setParameters(Hashtable params)
Set the parameters to be used with the conditions.

If the conditions have any named parameters, this must be called before calling getWhereCondition(), getParameterValues(), or getColumns(). Note that calling this method causes conditions with IN parameters to be reparsed, even if the Hashtable of parameters has not changed. Thus, it is best to call it as little as possible.

Parameters:
params - A Hashtable containing parameter names and values. Parameter names must start with a dollar sign ($). If a parameter value is null, do not included it in the Hashtable. If there are no parameters or all parameters are null, pass a null value.
 o getWhereCondition
 public final String getWhereCondition() throws XMLMiddlewareException
Get the condition that can be appended to the WHERE clause.

This condition has parameter names replaced with ?'s and all conditions AND'ed together.

Returns:
The condition. This may be zero-length but is never null.
Throws: XMLMiddlewareException
Thrown if a named parameter is found in a condition but no corresponding column is found in the table.
 o getColumns
 public final Column[] getColumns() throws XMLMiddlewareException
Get a list of Column objects corresponding to the parameters.

These occur in the order the corresponding names appear in the WHERE condition.

Returns:
The list. May be null.
Throws: XMLMiddlewareException
Thrown if a named parameter is found in a condition but no corresponding column is found in the table.
 o getParameterValues
 public final Object[] getParameterValues() throws XMLMiddlewareException
Get a list of parameter values.

These occur in the order the corresponding names appear in the WHERE condition.

Returns:
The list. May be null.
Throws: XMLMiddlewareException
Thrown if a named parameter is found in a condition but no corresponding column is found in the table.

All Packages  Class Hierarchy  This Package  Previous  Next  Index