diva.util.xml
Class AbstractXmlBuilder

java.lang.Object
  extended by diva.util.xml.AbstractXmlBuilder
All Implemented Interfaces:
XmlBuilder
Direct Known Subclasses:
BasicStrokeBuilder, ClassBuilder, CompositeBuilder, DashedPathData, PanRecognizer.PanData, SceneBuilder, SceneClassBuilder, SimpleData, StrokeSceneBuilder, TextAnnotations, TextData, VotingSceneBuilder, VotingStrokeBuilder, ZoomRecognizer.ZoomData

public abstract class AbstractXmlBuilder
extends 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:
$Revision: 1.2 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Constructor Summary
AbstractXmlBuilder()
           
 
Method Summary
abstract  Object build(XmlElement elt, String type)
          Given an XmlElement, create and return an internal representtion of it.
 XmlElement generate(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 Object build(XmlElement elt,
                             String type)
                      throws Exception
Given an XmlElement, create and return an internal representtion 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:
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(Object in)
                    throws Exception
Unable to generate XML by default.

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


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.