diva.util.xml
Class AbstractXmlBuilder

java.lang.Object
  extended by diva.util.xml.AbstractXmlBuilder
All Implemented Interfaces:
XmlBuilder
Direct Known Subclasses:
CompositeBuilder

public abstract class AbstractXmlBuilder
extends java.lang.Object
implements XmlBuilder

An abstract implementation of the XmlBuilder interface that gets and sets a delegate, leaves the build method abstract, and doesn't support the generate method.

Version:
$Id: AbstractXmlBuilder.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman
Accepted Rating:
Red

Field Summary
private  XmlBuilder _delegate
           
 
Constructor Summary
AbstractXmlBuilder()
           
 
Method Summary
abstract  java.lang.Object build(XmlElement elt, java.lang.String type)
          Given an XmlElement, create and return an internal representation of it.
 XmlElement generate(java.lang.Object in)
          Unable to generate XML by default.
 XmlBuilder getDelegate()
          Return the delegate set by getDelegate().
 void setDelegate(XmlBuilder delegate)
          Delegate builders can be used to build/generate for objects that are unknown by the current builder, as might be the case in a hierarchy of heterogeneous objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_delegate

private XmlBuilder _delegate
Constructor Detail

AbstractXmlBuilder

public AbstractXmlBuilder()
Method Detail

build

public abstract java.lang.Object build(XmlElement elt,
                                       java.lang.String type)
                                throws java.lang.Exception
Given an XmlElement, create and return an internal representation of it. Implementors should also provide a more type-specific version of this method:
   public Graph build (XmlELement elt, String type);
 

Specified by:
build in interface XmlBuilder
Throws:
java.lang.Exception

setDelegate

public void setDelegate(XmlBuilder delegate)
Delegate builders can be used to build/generate for objects that are unknown by the current builder, as might be the case in a hierarchy of heterogeneous objects.

Specified by:
setDelegate in interface XmlBuilder
See Also:
CompositeBuilder

getDelegate

public XmlBuilder getDelegate()
Return the delegate set by getDelegate().


generate

public XmlElement generate(java.lang.Object in)
                    throws java.lang.Exception
Unable to generate XML by default.

Specified by:
generate in interface XmlBuilder
Throws:
java.lang.UnsupportedOperationException - Unable to generate XML by default
java.lang.Exception