|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.clex.util.XMLGeneratorBase
Generates an xml document object for a given Values. If the Values contains another Values, the contained Values will be transformed into child elements. i.e. if an Agent has a reference to a Person, the result will be:
<agent>
<department>agent's Department</department>
<person>
<lastName>Doe</lastName>
<firstName>John</firstName>
</person>
</agent>
Usage:
XMLGeneratorBase xg = new XMLGeneratorBase ("rootName", Values)
org.w3c.dom.Document = xg.generate();
Field Summary | |
protected org.w3c.dom.Document |
doc
|
protected org.w3c.dom.Element |
tmpchild
|
static java.lang.String |
XML_VERSION
XML Version number |
Constructor Summary | |
XMLGeneratorBase()
Default constructor |
|
XMLGeneratorBase(java.lang.String aRootName)
Constructor that accepts a name for the root element |
|
XMLGeneratorBase(java.lang.String aRootName,
java.lang.Boolean useJaxp)
Constructor that accepts a name for the root element and a boolean to use jaxp-compliant code or not. |
|
XMLGeneratorBase(java.lang.String aRootName,
java.util.Hashtable anValues)
Constructor that accepts a name for the root element and an Values object which will be transformed into XML |
|
XMLGeneratorBase(java.lang.String aRootName,
java.util.Hashtable anValues,
java.lang.Boolean useJaxp)
Constructor that accepts a name for the root element and an Values object which will be transformed into XML and a boolean to use jaxp-compliant code or not. |
|
XMLGeneratorBase(java.lang.String aRootName,
java.util.Vector anValues,
java.lang.String childname)
Constructor that accepts a name for the root element and child element and an Values object which will be transformed into XML |
|
XMLGeneratorBase(java.lang.String aRootName,
java.util.Vector anValues,
java.lang.String childname,
java.lang.Boolean useJaxp)
Constructor that accepts a name for the root element and child element and an Values object which will be transformed into XML and a boolean to use jaxp-compliant code or not. |
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 |
buildNodeForValues(org.w3c.dom.Element parent)
Builds a node for the Values that is set |
protected void |
buildNodeForValues(org.w3c.dom.Element parent,
java.util.Hashtable anValues)
Builds a node for the given Values |
protected void |
buildNodeForValues(org.w3c.dom.Element parent,
java.lang.Object anValues)
Builds a node for the given Values |
protected void |
buildNodeForValues(org.w3c.dom.Element parent,
java.util.Vector anValues)
Builds a node for the given Values |
protected void |
createDocument()
Creates the Document |
org.w3c.dom.Document |
generate()
Returns the Document (XMLDocument) that is generated from the Values. |
java.lang.String |
getChildname()
|
java.lang.String |
getRootName()
Returns the name to be use for the root element |
java.lang.Object |
getValues()
|
void |
setChildname(java.lang.String newChildname)
|
void |
setRootName(java.lang.String aRootName)
Sets the name to be used for the root element |
void |
setValues(java.lang.Object newValues)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String XML_VERSION
protected org.w3c.dom.Document doc
protected org.w3c.dom.Element tmpchild
Constructor Detail |
public XMLGeneratorBase()
public XMLGeneratorBase(java.lang.String aRootName, java.util.Hashtable anValues)
java.lang.String
- Name to be used for the root elementHashtable
- The Values to be transformedpublic XMLGeneratorBase(java.lang.String aRootName, java.util.Hashtable anValues, java.lang.Boolean useJaxp)
java.lang.String
- Name to be used for the root elementHashtable
- The Values to be transformedpublic XMLGeneratorBase(java.lang.String aRootName, java.util.Vector anValues, java.lang.String childname)
java.lang.String
- Name to be used for the root elementVector
- The Values to be transformedString
- The child namepublic XMLGeneratorBase(java.lang.String aRootName, java.util.Vector anValues, java.lang.String childname, java.lang.Boolean useJaxp)
java.lang.String
- Name to be used for the root elementVector
- The Values to be transformedString
- The child namepublic XMLGeneratorBase(java.lang.String aRootName)
java.lang.String
- Name to be used for the root elementpublic XMLGeneratorBase(java.lang.String aRootName, java.lang.Boolean useJaxp)
java.lang.String
- Name to be used for the root elementboolean
- useJaxpMethod Detail |
public void setRootName(java.lang.String aRootName)
public java.lang.String getRootName()
public org.w3c.dom.Document generate()
protected void buildNodeForValues(org.w3c.dom.Element parent)
org.w3c.dom.Element
- The parent node for the Valuesprotected void buildNodeForValues(org.w3c.dom.Element parent, java.lang.Object anValues)
org.w3c.dom.Element
- The parent node for the ValuesObject
- The Values to be transformed.protected void buildNodeForValues(org.w3c.dom.Element parent, java.util.Hashtable anValues)
org.w3c.dom.Element
- The parent node for the ValuesHashtable
- The Values to be transformed.protected void buildNodeForValues(org.w3c.dom.Element parent, java.util.Vector anValues)
org.w3c.dom.Element
- The parent node for the ValuesVector
- The Values to be transformed.protected void createDocument() throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.ClassNotFoundException
- java.lang.IllegalAccessException
- java.lang.InstantiationException
- Enhancement # 1575374 - Added jaxp code to retrieve a new document using
the document builder rather than a hardcoded oracle doc.protected void addChild(org.w3c.dom.Element parent, java.lang.String childElementName, java.lang.Object childValue)
org.w3c.dom.Element
- The parent Element to add a child tojava.lang.String
- The name of the child elementjava.lang.Object
- The value of the childpublic java.lang.Object getValues()
public void setValues(java.lang.Object newValues) throws CollectionTypeNotSupportedException
public java.lang.String getChildname()
public void setChildname(java.lang.String newChildname)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |