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
-
FilterSet(XMLDBMSMap)
- Construct a new FilterSet object.
-
addNamespace(String, String)
- Add a namespace prefix and URI.
-
addWrapperName(XMLName, int)
- Add a wrapper element name at the specified nesting level.
-
createResultSetFilter(String)
- Create a result set filter.
-
createRootFilter()
- Create a root filter.
-
getFilters()
- Get the filters.
-
getNamespacePrefix(String)
- Get a namespace prefix.
-
getNamespacePrefixes()
- Get a Hashtable containing all namespace prefixes hashed by URI.
-
getNamespaceURI(String)
- Get a namespace URI.
-
getNamespaceURIs()
- Get a Hashtable containing all namespace URIs hashed by prefix.
-
getWrapperName(int)
- Get a specific wrapper element name.
-
getWrapperNames()
- Get the wrapper element names.
-
removeAllFilters()
- Remove all filters.
-
removeAllWrapperNames()
- Remove all wrapper element names.
-
removeFilter(int)
- Remove the ith filter.
-
removeNamespaceByPrefix(String)
- Remove a namespace prefix and URI.
-
removeNamespaceByURI(String)
- Remove a namespace prefix and URI.
-
removeNamespaces()
- Remove all namespace URIs.
-
removeWrapperName(int)
- Remove the wrapper element at the specified nesting level.
-
setFilterParameters(Hashtable)
- Set the parameters to use with the filters.
FilterSet
public FilterSet(XMLDBMSMap map)
- Construct a new FilterSet object.
- Parameters:
- map - The XMLDBMSMap to which the filter set applies.
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.
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.
getNamespaceURIs
public final Hashtable getNamespaceURIs()
- Get a Hashtable containing all namespace URIs hashed by prefix.
- Returns:
- The Hashtable.
getNamespacePrefixes
public final Hashtable getNamespacePrefixes()
- Get a Hashtable containing all namespace prefixes hashed by URI.
- Returns:
- The Hashtable.
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.
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.
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.
removeNamespaces
public void removeNamespaces()
- Remove all namespace URIs.
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
getWrapperNames
public final Vector getWrapperNames()
- Get the wrapper element names.
- Returns:
- A Vector containing the XMLNames of the wrapper elements. May be empty.
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.
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.
removeAllWrapperNames
public void removeAllWrapperNames()
- Remove all wrapper element names.
getFilters
public final Vector getFilters()
- Get the filters.
- Returns:
- A Vector containing RootFilter and ResultSetFilter objects
createRootFilter
public RootFilter createRootFilter()
- Create a root filter.
- Returns:
- The root filter.
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.
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.
removeAllFilters
public void removeAllFilters()
- Remove all filters.
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