diva.compat.xml
Class CompositeBuilder

java.lang.Object
  extended by diva.compat.xml.AbstractXmlBuilder
      extended by diva.compat.xml.CompositeBuilder
All Implemented Interfaces:
XmlBuilder

public class CompositeBuilder
extends AbstractXmlBuilder

CompositeBuilder is a non-validating parser that uses other builders to parse and generate XML files from arbitary collections of objects. (FIXME - more documentation here)

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

Field Summary
static String BUILDER_DECLS_TAG
          Indicates a group of builder declarations
static String BUILDER_TAG
          Indicates a builder for a recognizer
static String CLASS_TAG
          Indicates a recognizer class
static String DTD_1
          The DTD for builder declarations.
static String DTD_URL
          The URL where the DTD is stored.
static String PUBLIC_ID
          The public identity of the RCL dtd file.
static String TAG_TAG
          Indicates the tag of a recognizer
 
Constructor Summary
CompositeBuilder()
           
 
Method Summary
 void addBuilderDecls(Reader in)
          Add all of the builder declarations in the given XML document to the builder map.
 Object build(XmlElement elt, String type)
          Build an object based on the XML element by looking up the appropriate builder and calling that builder on the element.
 XmlElement generate(Object in)
          Build an XML element based on given object by looking up the appropriate builder based on the object's class name and calling that builder's generate method on the object.
static void main(String[] args)
          Simple test of this class.
 
Methods inherited from class diva.compat.xml.AbstractXmlBuilder
getDelegate, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_ID

public static final String PUBLIC_ID
The public identity of the RCL dtd file.

See Also:
Constant Field Values

DTD_URL

public static final String DTD_URL
The URL where the DTD is stored.

See Also:
Constant Field Values

DTD_1

public static final String DTD_1
The DTD for builder declarations.

See Also:
Constant Field Values

CLASS_TAG

public static final String CLASS_TAG
Indicates a recognizer class

See Also:
Constant Field Values

TAG_TAG

public static final String TAG_TAG
Indicates the tag of a recognizer

See Also:
Constant Field Values

BUILDER_TAG

public static final String BUILDER_TAG
Indicates a builder for a recognizer

See Also:
Constant Field Values

BUILDER_DECLS_TAG

public static final String BUILDER_DECLS_TAG
Indicates a group of builder declarations

See Also:
Constant Field Values
Constructor Detail

CompositeBuilder

public CompositeBuilder()
Method Detail

addBuilderDecls

public void addBuilderDecls(Reader in)
                     throws Exception
Add all of the builder declarations in the given XML document to the builder map.

Throws:
Exception

build

public Object build(XmlElement elt,
                    String type)
             throws Exception
Build an object based on the XML element by looking up the appropriate builder and calling that builder on the element.

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

generate

public XmlElement generate(Object in)
                    throws Exception
Build an XML element based on given object by looking up the appropriate builder based on the object's class name and calling that builder's generate method on the object.

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

main

public static void main(String[] args)
                 throws Exception
Simple test of this class.

Throws:
Exception


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