com.cafesoft.core.xml.dom
Class AbstractElementFactory

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

public abstract class AbstractElementFactory
extends Object
implements ElementFactory

AbstractElementFactory implements an abstract factory class for constructing an Object associated with an XML DOM Element. It provides reusable implementation for basic set/get methods and useful constructors. Concrete implementations must override the create() method.


Field Summary
protected  String localName
          The local name.
protected  String nameSpace
          The name space
 
Constructor Summary
AbstractElementFactory()
          Create a new ElementFactory.
AbstractElementFactory(String nameSpace, String localName)
          Create a new ElementFactory.
 
Method Summary
abstract  Object create(Element element)
          Create the Object associated with an XML Element.
 String getLocalName()
          Return the Element local name associated with this ElementFactory.
 String getNameSpace()
          Return the name space associated with this ElementFactory.
 void setLocalName(String localName)
          Set the Element local name associated with this ElementFactory.
 void setNameSpace(String nameSpace)
          Set the XML name space associated with this ElementFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameSpace

protected String nameSpace
The name space


localName

protected String localName
The local name.

Constructor Detail

AbstractElementFactory

public AbstractElementFactory()
Create a new ElementFactory.


AbstractElementFactory

public AbstractElementFactory(String nameSpace,
                              String localName)
Create a new ElementFactory.

Parameters:
nameSpace - the XML name space associated with the Element.
localName - the XML local name associated with the Element.
Method Detail

setNameSpace

public void setNameSpace(String nameSpace)
Set the XML name space associated with this ElementFactory.

Specified by:
setNameSpace in interface ElementFactory
Parameters:
nameSpace - the name space.

getNameSpace

public String getNameSpace()
Return the name space associated with this ElementFactory.

Specified by:
getNameSpace in interface ElementFactory
Returns:
the name space.

setLocalName

public void setLocalName(String localName)
Set the Element local name associated with this ElementFactory.

Specified by:
setLocalName in interface ElementFactory
Parameters:
localName - the local name.

getLocalName

public String getLocalName()
Return the Element local name associated with this ElementFactory.

Specified by:
getLocalName in interface ElementFactory
Returns:
the local name.

create

public abstract Object create(Element element)
                       throws ElementFactoryException
Create the Object associated with an XML Element.

Specified by:
create in interface ElementFactory
Parameters:
element - the XML DOM Element.
Returns:
the Object constructed from the Element or Element sub-tree.
ElementFactoryException


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.