oracle.clex.util
Class XMLGenerator

java.lang.Object
  |
  +--oracle.clex.util.XMLGeneratorBase
        |
        +--oracle.clex.util.XMLGenerator

public class XMLGenerator
extends XMLGeneratorBase

Generates an xml document object for a given Offerable. If the Offerable contains another Offerable, the contained offerable will be transformed into child elements. i.e. if an Agent has a reference a Person, the result will be:

 
   <agent>
     <department>agent's Department</department>
     <person>
       <lastName>Doe</lastName>
       <firstName>John</firstName>
     </person>
   </agent>
 
 

Usage:
XMLGenerator xg = new XMLGenerator ("rootName", Offerable)
org.w3c.dom.Document = xg.generate();

At this time, it does not valid againts a DTD, though this might something that we may need to do in the future


Fields inherited from class oracle.clex.util.XMLGeneratorBase
doc, tmpchild, XML_VERSION
 
Constructor Summary
XMLGenerator()
          Default constructor
XMLGenerator(java.lang.String aRootName, Offerable anOfferable)
          Constructor that accepts a name for the root element and an offerable object which will be transformed into XML
 
Method Summary
protected  void addChild(org.w3c.dom.Element parent, java.lang.String childElementName, java.lang.Object childValue)
          Transforms the child element and adds it to the parent node
protected  void buildNodeForOfferable(org.w3c.dom.Element parent)
          Builds a node for the offerable that is set
protected  void buildNodeForOfferable(org.w3c.dom.Element parent, Offerable anOfferable)
          Builds a node for the given offerable
 Offerable getOfferable()
          Returns the offerable that is to be transformed
 void setOfferable(Offerable anOfferable)
          Sets the offerable to be transformed into XML
 
Methods inherited from class oracle.clex.util.XMLGeneratorBase
buildNodeForValues, buildNodeForValues, buildNodeForValues, buildNodeForValues, createDocument, generate, getChildname, getRootName, getValues, setChildname, setRootName, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLGenerator

public XMLGenerator()
Default constructor

XMLGenerator

public XMLGenerator(java.lang.String aRootName,
                    Offerable anOfferable)
Constructor that accepts a name for the root element and an offerable object which will be transformed into XML
Parameters:
java.lang.String - Name to be used for the root element
com.insignia.resource.Offerable - The offerable to be transformed
Method Detail

setOfferable

public void setOfferable(Offerable anOfferable)
Sets the offerable to be transformed into XML
Parameters:
com.insignia.resource.Offerable - The offerable to be transformed

getOfferable

public Offerable getOfferable()
Returns the offerable that is to be transformed
Returns:
com.insignia.resource.Offerable

buildNodeForOfferable

protected void buildNodeForOfferable(org.w3c.dom.Element parent)
Builds a node for the offerable that is set
Parameters:
org.w3c.dom.Element - The parent node for the offerable

buildNodeForOfferable

protected void buildNodeForOfferable(org.w3c.dom.Element parent,
                                     Offerable anOfferable)
Builds a node for the given offerable
Parameters:
org.w3c.dom.Element - The parent node for the offerable
com.insignia.resourc.Offerable - The offerable to be transformed.

addChild

protected void addChild(org.w3c.dom.Element parent,
                        java.lang.String childElementName,
                        java.lang.Object childValue)
Transforms the child element and adds it to the parent node
Overrides:
addChild in class XMLGeneratorBase
Parameters:
org.w3c.dom.Element - The parent Element to add a child to
java.lang.String - The name of the child element
java.lang.Object - The value of the child


Copyright © 2003 ORACLE Corp. All Rights Reserved.