Package org.apache.commons.chain.impl
Class CatalogFactoryBase<C extends Context>
java.lang.Object
org.apache.commons.chain.CatalogFactory<C>
org.apache.commons.chain.impl.CatalogFactoryBase<C>
- Type Parameters:
C- Type of the context associated with this command
A simple implementation of
CatalogFactory.- Version:
- $Revision$ $Date$
- Author:
- Sean Schofield
-
Field Summary
Fields inherited from class org.apache.commons.chain.CatalogFactory
DELIMITER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCatalog(String name, Catalog<C> 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<C> catalog) Sets the default instance of Catalog associated with the factory.Methods inherited from class org.apache.commons.chain.CatalogFactory
clear, getCommand, getInstance
-
Constructor Details
-
CatalogFactoryBase
public CatalogFactoryBase()Construct an empty instance ofCatalogFactoryBase. This constructor is intended solely for use byCatalogFactory.
-
-
Method Details
-
getCatalog
Gets the default instance of Catalog associated with the factory (if any); otherwise, returnnull.- Specified by:
getCatalogin classCatalogFactory<C extends Context>- Returns:
- the default Catalog instance
-
setCatalog
Sets the default instance of Catalog associated with the factory.- Specified by:
setCatalogin classCatalogFactory<C extends Context>- Parameters:
catalog- the default Catalog instance
-
getCatalog
Retrieves a Catalog instance by name (if any); otherwise returnnull.- Specified by:
getCatalogin classCatalogFactory<C extends Context>- 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<C extends Context>- Parameters:
name- the name of the Catalog to addcatalog- the Catalog to add
-
getNames
Return anIteratorover the set of namedCatalogs known to thisCatalogFactory. If there are no known catalogs, an empty Iterator is returned.- Specified by:
getNamesin classCatalogFactory<C extends Context>- Returns:
- An Iterator of the names of the Catalogs known by this factory.
-