Package org.apache.commons.chain.impl
Class CatalogFactoryBase
- java.lang.Object
-
- org.apache.commons.chain.CatalogFactory
-
- org.apache.commons.chain.impl.CatalogFactoryBase
-
public class CatalogFactoryBase extends CatalogFactory
A simple implementation of
CatalogFactory
.- Version:
- $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
-
-
Field Summary
Fields Modifier and Type Field Description private Catalog
catalog
The defaultCatalog
for thisCatalogFactory
.private java.util.Map
catalogs
Map of namedCatalog
s, keyed by catalog name.-
Fields inherited from class org.apache.commons.chain.CatalogFactory
DELIMITER
-
-
Constructor Summary
Constructors Constructor Description CatalogFactoryBase()
Construct an empty instance ofCatalogFactoryBase
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCatalog(java.lang.String name, Catalog catalog)
Adds a named instance of Catalog to the factory (for subsequent retrieval later).Catalog
getCatalog()
Gets the default instance of Catalog associated with the factory (if any); otherwise, returnnull
.Catalog
getCatalog(java.lang.String name)
Retrieves a Catalog instance by name (if any); otherwise returnnull
.java.util.Iterator
getNames()
void
setCatalog(Catalog catalog)
Sets the default instance of Catalog associated with the factory.-
Methods inherited from class org.apache.commons.chain.CatalogFactory
clear, getCommand, getInstance
-
-
-
-
Field Detail
-
catalog
private Catalog catalog
The default
Catalog
for thisCatalogFactory
.
-
catalogs
private java.util.Map catalogs
Map of named
Catalog
s, keyed by catalog name.
-
-
Constructor Detail
-
CatalogFactoryBase
public CatalogFactoryBase()
Construct an empty instance of
CatalogFactoryBase
. This constructor is intended solely for use byCatalogFactory
.
-
-
Method Detail
-
getCatalog
public Catalog getCatalog()
Gets the default instance of Catalog associated with the factory (if any); otherwise, return
null
.- Specified by:
getCatalog
in classCatalogFactory
- Returns:
- the default Catalog instance
-
setCatalog
public void setCatalog(Catalog catalog)
Sets the default instance of Catalog associated with the factory.
- Specified by:
setCatalog
in classCatalogFactory
- Parameters:
catalog
- the default Catalog instance
-
getCatalog
public Catalog getCatalog(java.lang.String name)
Retrieves a Catalog instance by name (if any); otherwise return
null
.- Specified by:
getCatalog
in classCatalogFactory
- Parameters:
name
- the name of the Catalog to retrieve- Returns:
- the specified Catalog
-
addCatalog
public void addCatalog(java.lang.String name, Catalog catalog)
Adds a named instance of Catalog to the factory (for subsequent retrieval later).
- Specified by:
addCatalog
in classCatalogFactory
- Parameters:
name
- the name of the Catalog to addcatalog
- the Catalog to add
-
getNames
public java.util.Iterator getNames()
Return an
Iterator
over the set of namedCatalog
s known to thisCatalogFactory
. If there are no known catalogs, an empty Iterator is returned.- Specified by:
getNames
in classCatalogFactory
- Returns:
- An Iterator of the names of the Catalogs known by this factory.
-
-