diva.sketch.rcl
Class ClassBuilder

java.lang.Object
  extended by diva.util.xml.AbstractXmlBuilder
      extended by diva.sketch.rcl.ClassBuilder
All Implemented Interfaces:
XmlBuilder

public class ClassBuilder
extends AbstractXmlBuilder

Translate to and from XML for objects whose only parameters are their class names.

Version:
$Revision: 1.3 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Constructor Summary
ClassBuilder()
           
 
Method Summary
 Object build(XmlElement elt, String type)
          Build an instance of the given type using Java reflection.
 XmlElement generate(Object in)
          Generate XML that contains the given object's class name and no children.
 
Methods inherited from class diva.util.xml.AbstractXmlBuilder
getDelegate, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassBuilder

public ClassBuilder()
Method Detail

build

public Object build(XmlElement elt,
                    String type)
             throws Exception
Build an instance of the given type using Java reflection.

Specified by:
build in interface XmlBuilder
Specified by:
build in class AbstractXmlBuilder
Throws:
Exception

generate

public XmlElement generate(Object in)
Generate XML that contains the given object's class name and no children.

Specified by:
generate in interface XmlBuilder
Overrides:
generate in class AbstractXmlBuilder


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