Package diva.util.xml
Class CompositeBuilder
- java.lang.Object
 - 
- diva.util.xml.AbstractXmlBuilder
 - 
- diva.util.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 arbitrary collections of objects. (FIXME - more documentation here)- Version:
 - $Id$
 - Author:
 - Michael Shilman
 - Pt.AcceptedRating:
 - Red
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBUILDER_DECLS_TAGIndicates a group of builder declarationsstatic java.lang.StringBUILDER_TAGIndicates a builder for a recognizerstatic java.lang.StringCLASS_TAGIndicates a recognizer classstatic java.lang.StringDTD_1The DTD for builder declarations.static java.lang.StringDTD_URLThe URL where the DTD is stored.static java.lang.StringPUBLIC_IDThe public identity of the RCL dtd file.static java.lang.StringTAG_TAGIndicates the tag of a recognizer 
- 
Constructor Summary
Constructors Constructor Description CompositeBuilder() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBuilderDecls(java.io.Reader in)Add all of the builder declarations in the given XML document to the builder map.java.lang.Objectbuild(XmlElement elt, java.lang.String type)Build an object based on the XML element by looking up the appropriate builder and calling that builder on the element.XmlElementgenerate(java.lang.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 voidmain(java.lang.String[] args)Simple test of this class.- 
Methods inherited from class diva.util.xml.AbstractXmlBuilder
getDelegate, setDelegate 
 - 
 
 - 
 
- 
- 
Field Detail
- 
PUBLIC_ID
public static final java.lang.String PUBLIC_ID
The public identity of the RCL dtd file.- See Also:
 - Constant Field Values
 
 
- 
DTD_URL
public static final java.lang.String DTD_URL
The URL where the DTD is stored.- See Also:
 - Constant Field Values
 
 
- 
DTD_1
public static final java.lang.String DTD_1
The DTD for builder declarations.- See Also:
 - Constant Field Values
 
 
- 
CLASS_TAG
public static final java.lang.String CLASS_TAG
Indicates a recognizer class- See Also:
 - Constant Field Values
 
 
- 
TAG_TAG
public static final java.lang.String TAG_TAG
Indicates the tag of a recognizer- See Also:
 - Constant Field Values
 
 
- 
BUILDER_TAG
public static final java.lang.String BUILDER_TAG
Indicates a builder for a recognizer- See Also:
 - Constant Field Values
 
 
- 
BUILDER_DECLS_TAG
public static final java.lang.String BUILDER_DECLS_TAG
Indicates a group of builder declarations- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
addBuilderDecls
public void addBuilderDecls(java.io.Reader in) throws java.lang.ExceptionAdd all of the builder declarations in the given XML document to the builder map.- Throws:
 java.lang.Exception
 
- 
build
public java.lang.Object build(XmlElement elt, java.lang.String type) throws java.lang.Exception
Build an object based on the XML element by looking up the appropriate builder and calling that builder on the element.- Specified by:
 buildin interfaceXmlBuilder- Specified by:
 buildin classAbstractXmlBuilder- Throws:
 java.lang.Exception
 
- 
generate
public XmlElement generate(java.lang.Object in) throws java.lang.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:
 generatein interfaceXmlBuilder- Overrides:
 generatein classAbstractXmlBuilder- Throws:
 java.lang.Exception
 
- 
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionSimple test of this class.- Throws:
 java.lang.Exception
 
 - 
 
 -