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
-
addCondition(String)
- Add a condition to the end of the list.
-
getColumns()
- Get a list of Column objects corresponding to the parameters.
-
getCondition(int)
- Get a specific condition.
-
getConditions()
- Get the conditions.
-
getParameterValues()
- Get a list of parameter values.
-
getTable()
- Get the table to which the filter conditions apply.
-
getWhereCondition()
- Get the condition that can be appended to the WHERE clause.
-
removeAllConditions()
- Remove all wrapper conditions.
-
removeCondition(int)
- Remove the specified condition.
-
setParameters(Hashtable)
- Set the parameters to be used with the conditions.
getTable
public final Table getTable()
- Get the table to which the filter conditions apply.
- Returns:
- The table.
getCondition
public final String getCondition(int index)
- Get a specific condition.
- Parameters:
- index - The index of the condition. 0-based.
- Returns:
- The condition
getConditions
public Vector getConditions()
- Get the conditions.
- Returns:
- A Vector containing the conditions as Strings.
addCondition
public void addCondition(String condition)
- Add a condition to the end of the list.
- Parameters:
- condition - The condition
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.
removeAllConditions
public void removeAllConditions()
- Remove all wrapper conditions.
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.
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.
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.
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