All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.xmldbms.filters.FilterSet

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

public class FilterSet
extends Object
A set of filters to be applied to the database to retrieve data.

The normal way to construct a FilterSet object is to write an XML document using the filter language (filters.dtd), then compile it into a FilterSet object. This is then passed to DBMSToDOM. For example:

    // Compile a filter document.
    compiler = new FilterCompiler(parserUtils);
    filterSet = compiler.compile(map, new InputSource(new FileReader("SalesFilter.ftr")));
    
// Retrieve the document according to the filter. doc = dbmsToDOM.retrieveDocument(transferInfo, filterSet, null, null);

Version:
2.0
Author:
Ronald Bourret, 2001

Constructor Index

 o FilterSet(XMLDBMSMap)
Construct a new FilterSet object.

Method Index

 o addNamespace(String, String)
Add a namespace prefix and URI.
 o addWrapperName(XMLName, int)
Add a wrapper element name at the specified nesting level.
 o createResultSetFilter(String)
Create a result set filter.
 o createRootFilter()
Create a root filter.
 o getFilters()
Get the filters.
 o getNamespacePrefix(String)
Get a namespace prefix.
 o getNamespacePrefixes()
Get a Hashtable containing all namespace prefixes hashed by URI.
 o getNamespaceURI(String)
Get a namespace URI.
 o getNamespaceURIs()
Get a Hashtable containing all namespace URIs hashed by prefix.
 o getWrapperName(int)
Get a specific wrapper element name.
 o getWrapperNames()
Get the wrapper element names.
 o removeAllFilters()
Remove all filters.
 o removeAllWrapperNames()
Remove all wrapper element names.
 o removeFilter(int)
Remove the ith filter.
 o removeNamespaceByPrefix(String)
Remove a namespace prefix and URI.
 o removeNamespaceByURI(String)
Remove a namespace prefix and URI.
 o removeNamespaces()
Remove all namespace URIs.
 o removeWrapperName(int)
Remove the wrapper element at the specified nesting level.
 o setFilterParameters(Hashtable)
Set the parameters to use with the filters.

Constructors

 o FilterSet
 public FilterSet(XMLDBMSMap map)
Construct a new FilterSet object.

Parameters:
map - The XMLDBMSMap to which the filter set applies.

Methods

 o getNamespaceURI
 public final String getNamespaceURI(String prefix) throws XMLMiddlewareException
Get a namespace URI.

Parameters:
prefix - The namespace prefix.
Returns:
The namespace URI.
Throws: XMLMiddlewareException
Thrown if the prefix is not found.
 o getNamespacePrefix
 public final String getNamespacePrefix(String uri) throws XMLMiddlewareException
Get a namespace prefix.

Parameters:
uri - The namespace URI.
Returns:
The namespace prefix.
Throws: XMLMiddlewareException
Thrown if the URI is not found.
 o getNamespaceURIs
 public final Hashtable getNamespaceURIs()
Get a Hashtable containing all namespace URIs hashed by prefix.

Returns:
The Hashtable.
 o getNamespacePrefixes
 public final Hashtable getNamespacePrefixes()
Get a Hashtable containing all namespace prefixes hashed by URI.

Returns:
The Hashtable.
 o addNamespace
 public void addNamespace(String prefix,
                          String uri) throws XMLMiddlewareException
Add a namespace prefix and URI.

Parameters:
prefix - The namespace prefix.
uri - The namespace URI.
Throws: XMLMiddlewareException
Thrown if the prefix or URI is already used.
 o removeNamespaceByPrefix
 public void removeNamespaceByPrefix(String prefix) throws XMLMiddlewareException
Remove a namespace prefix and URI.

Parameters:
prefix - The namespace prefix.
Throws: XMLMiddlewareException
Thrown if the prefix is not found.
 o removeNamespaceByURI
 public void removeNamespaceByURI(String uri) throws XMLMiddlewareException
Remove a namespace prefix and URI.

Parameters:
prefix - The namespace prefix.
Throws: XMLMiddlewareException
Thrown if the prefix is not found.
 o removeNamespaces
 public void removeNamespaces()
Remove all namespace URIs.

 o getWrapperName
 public final XMLName getWrapperName(int level)
Get a specific wrapper element name.

Parameters:
level - The nesting level of the wrapper element. 1-based.
Returns:
XMLName of the wrapper element
 o getWrapperNames
 public final Vector getWrapperNames()
Get the wrapper element names.

Returns:
A Vector containing the XMLNames of the wrapper elements. May be empty.
 o addWrapperName
 public void addWrapperName(XMLName wrapperName,
                            int level) throws XMLMiddlewareException
Add a wrapper element name at the specified nesting level.

This method shifts wrapper element names at or above the specified nesting level upward one position.

Parameters:
wrapperName - XMLName of the wrapper element.
level - Nesting level of the wrapper element. This number is 1-based. A value of 0 means to append the wrapper element name to the end of the list.
Throws: XMLMiddlewareException
Thrown if the nesting level is greater than the highest nesting level plus 1.
 o removeWrapperName
 public void removeWrapperName(int level) throws XMLMiddlewareException
Remove the wrapper element at the specified nesting level.

This method shifts wrapper element names at or above the specified nesting level downward one position.

Parameters:
level - Nesting level of the wrapper element name. This number is 1-based.
Throws: XMLMiddlewareException
Thrown if the nesting level is greater than the highest nesting level.
 o removeAllWrapperNames
 public void removeAllWrapperNames()
Remove all wrapper element names.

 o getFilters
 public final Vector getFilters()
Get the filters.

Returns:
A Vector containing RootFilter and ResultSetFilter objects
 o createRootFilter
 public RootFilter createRootFilter()
Create a root filter.

Returns:
The root filter.
 o createResultSetFilter
 public ResultSetFilter createResultSetFilter(String name) throws XMLMiddlewareException
Create a result set filter.

Parameters:
name - The name used to identify the result set. If this is null, "Default" is used.
Returns:
The filter.
Throws: XMLMiddlewareException
Thrown if the name is already being used.
 o removeFilter
 public void removeFilter(int index) throws XMLMiddlewareException
Remove the ith filter.

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

Parameters:
index - Index of the filter to remove. 0-based.
Throws: XMLMiddlewareException
Thrown if the index is invalid.
 o removeAllFilters
 public void removeAllFilters()
Remove all filters.

 o setFilterParameters
 public void setFilterParameters(Hashtable params)
Set the parameters to use with the filters.

This method should be called before the filters are used to construct WHERE clauses, since the filters are optimized for the parameters only being set once.

Parameters:
params - A Hashtable containing the names (keys) and values (elements) of any parameters used in the filters. Null if there are no parameters.

All Packages  Class Hierarchy  This Package  Previous  Next  Index