Class CatalogFactoryBase
java.lang.Object
org.apache.commons.chain.CatalogFactory
org.apache.commons.chain.impl.CatalogFactoryBase
A simple implementation of CatalogFactory.
- Version:
- $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
- Author:
- Sean Schofield
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CatalogThe defaultCatalogfor thisCatalogFactory.private MapMap of namedCatalogs, keyed by catalog name.Fields inherited from class CatalogFactory
DELIMITER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCatalog(String name, Catalog catalog) Adds a named instance of Catalog to the factory (for subsequent retrieval later).Gets the default instance of Catalog associated with the factory (if any); otherwise, returnnull.getCatalog(String name) Retrieves a Catalog instance by name (if any); otherwise returnnull.getNames()voidsetCatalog(Catalog catalog) Sets the default instance of Catalog associated with the factory.Methods inherited from class CatalogFactory
clear, getCommand, getInstance
-
Field Details
-
catalog
The default
Catalogfor thisCatalogFactory. -
catalogs
-
-
Constructor Details
-
CatalogFactoryBase
public CatalogFactoryBase()Construct an empty instance of
CatalogFactoryBase. This constructor is intended solely for use byCatalogFactory.
-
-
Method Details
-
getCatalog
Gets the default instance of Catalog associated with the factory (if any); otherwise, return
null.- Specified by:
getCatalogin classCatalogFactory- Returns:
- the default Catalog instance
-
setCatalog
Sets the default instance of Catalog associated with the factory.
- Specified by:
setCatalogin classCatalogFactory- Parameters:
catalog- the default Catalog instance
-
getCatalog
Retrieves a Catalog instance by name (if any); otherwise return
null.- Specified by:
getCatalogin classCatalogFactory- Parameters:
name- the name of the Catalog to retrieve- Returns:
- the specified Catalog
-
addCatalog
Adds a named instance of Catalog to the factory (for subsequent retrieval later).
- Specified by:
addCatalogin classCatalogFactory- Parameters:
name- the name of the Catalog to addcatalog- the Catalog to add
-
getNames
Return an
Iteratorover the set of namedCatalogs known to thisCatalogFactory. If there are no known catalogs, an empty Iterator is returned.- Specified by:
getNamesin classCatalogFactory- Returns:
- An Iterator of the names of the Catalogs known by this factory.
-