org.apache.commons.chain.impl
Class CatalogFactoryBase

java.lang.Object
  extended by org.apache.commons.chain.CatalogFactory
      extended by 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) $
Author:
Sean Schofield

Field Summary
 
Fields inherited from class org.apache.commons.chain.CatalogFactory
DELIMITER
 
Constructor Summary
CatalogFactoryBase()
          Construct an empty instance of CatalogFactoryBase.
 
Method Summary
 void addCatalog(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, return null.
 Catalog getCatalog(String name)
          Retrieves a Catalog instance by name (if any); otherwise return null.
 Iterator getNames()
          Return an Iterator over the set of named Catalogs known to this CatalogFactory.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogFactoryBase

public CatalogFactoryBase()

Construct an empty instance of CatalogFactoryBase. This constructor is intended solely for use by CatalogFactory.

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 class CatalogFactory
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 class CatalogFactory
Parameters:
catalog - the default Catalog instance

getCatalog

public Catalog getCatalog(String name)

Retrieves a Catalog instance by name (if any); otherwise return null.

Specified by:
getCatalog in class CatalogFactory
Parameters:
name - the name of the Catalog to retrieve
Returns:
the specified Catalog

addCatalog

public void addCatalog(String name,
                       Catalog catalog)

Adds a named instance of Catalog to the factory (for subsequent retrieval later).

Specified by:
addCatalog in class CatalogFactory
Parameters:
name - the name of the Catalog to add
catalog - the Catalog to add

getNames

public Iterator getNames()

Return an Iterator over the set of named Catalogs known to this CatalogFactory. If there are no known catalogs, an empty Iterator is returned.

Specified by:
getNames in class CatalogFactory
Returns:
An Iterator of the names of the Catalogs known by this factory.


Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.