com.cafesoft.core.xml.dom
Class StandardElementFactoryRegistry

java.lang.Object
  |
  +--com.cafesoft.core.xml.dom.StandardElementFactoryRegistry
All Implemented Interfaces:
ElementFactoryRegistry

public class StandardElementFactoryRegistry
extends Object
implements ElementFactoryRegistry

StandardElementFactoryRegistry implements a registry for ElementFactory instances. Each ElementFactory is associated with a node within an XML Document Object Model by:

  1. namespace
  2. tag name
and registers a factory class for constructing Object instances associated with an Element hierarchy. This enables an XML document to be extended with new implementations of known interfaces.


Field Summary
protected  Map efMap
          A Map of ElementFactory instances hashed by (namespace + element)
 
Constructor Summary
StandardElementFactoryRegistry()
          Create a new StandardElementFactoryRegistry.
 
Method Summary
 void add(ElementFactory ef)
          Add an ElementFactory.
 ElementFactory get(String nameSpace, String tagName)
          Get an ElementFactory.
 ElementFactory[] getAll()
          Get all ElementFactories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

efMap

protected Map efMap
A Map of ElementFactory instances hashed by (namespace + element)

Constructor Detail

StandardElementFactoryRegistry

public StandardElementFactoryRegistry()
Create a new StandardElementFactoryRegistry.

Method Detail

add

public void add(ElementFactory ef)
Add an ElementFactory.

Specified by:
add in interface ElementFactoryRegistry
Parameters:
ef - the ElementFactory.

get

public ElementFactory get(String nameSpace,
                          String tagName)
Get an ElementFactory.

Specified by:
get in interface ElementFactoryRegistry
Parameters:
nameSpace - the NameSpace (e.g. http://cafesoft.com/goober)
tagName - the Element tag name.
Returns:
the ElementFactory associated with the namespace and tagname (case insensitive) or null if no ElementFactory is registered.

getAll

public ElementFactory[] getAll()
Get all ElementFactories.

Specified by:
getAll in interface ElementFactoryRegistry
Returns:
an array of all registered ElementFactory instances.


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.