Package diva.util.xml

Class 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$
    Author:
    Michael Shilman
    Pt.AcceptedRating:
    Red
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      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
    • 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