public class XmlWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log
Used for logging.
|
Constructor and Description |
---|
XmlWriter(java.lang.String fileName,
java.lang.String rootElementName)
XML Writer constructor, creates the reference to a file writer with the given file name.
|
XmlWriter(java.lang.String fileName,
java.lang.String rootElementName,
java.lang.String rootElementText)
XML Writer constructor, creates the reference to the file writer with the given file name.
|
XmlWriter(java.lang.String fileName,
java.lang.String rootElementName,
java.lang.String rootElementText,
java.util.Hashtable attributes)
XmlWriter constructor, creates the file writer with the given file name.
|
XmlWriter(java.lang.String fileName,
java.lang.String rootElementName,
java.lang.String rootElementText,
java.util.Hashtable attributes,
java.lang.String characterSet)
XmlWriter constructor, creates the file writer with the given file name.
|
Modifier and Type | Method and Description |
---|---|
org.dom4j.Element |
addElement(org.dom4j.Element elementToAppendTo,
java.lang.String name)
Adds a new element to the specified element with the given tag name and text.
|
org.dom4j.Element |
addElement(org.dom4j.Element elementToAppendTo,
java.lang.String name,
java.lang.String text)
Adds a new element to the specified element with the given tag name and text.
|
org.dom4j.Element |
addElement(org.dom4j.Element elementToAppendTo,
java.lang.String name,
java.lang.String text,
java.util.Hashtable attributes)
Main entry point for adding elements.
|
org.dom4j.Element |
addElement(java.lang.String name)
Adds a new element to the root element with the given tag name.
|
org.dom4j.Element |
addElement(java.lang.String name,
java.util.Hashtable attributes)
Adds a new element to the root element with the given tag name and text.
|
org.dom4j.Element |
addElement(java.lang.String name,
java.lang.String text)
Adds a new element to the root element with the given tag name and text.
|
org.dom4j.Element |
addElement(java.lang.String name,
java.lang.String text,
java.util.Hashtable attributes)
Adds a new element to the root element with the given tag name and text.
|
org.dom4j.Element |
addElements(org.dom4j.Element elementToAppendTo,
java.lang.String name,
java.util.Hashtable subElements)
Creates a new parent Element and appends children to it.
|
org.dom4j.Element |
addElements(org.dom4j.Element elementToAppendTo,
java.lang.String name,
java.lang.String text,
java.util.Hashtable subElements)
Creates a new parent Element and appends children to it.
|
org.dom4j.Element |
addElements(org.dom4j.Element elementToAppendTo,
java.lang.String name,
java.lang.String text,
java.util.Hashtable attributes,
java.util.Hashtable subElements)
All other addElements() methods should call this method with null as any missing values.
|
void |
addElements(java.lang.String containingTagName,
DataSet dataSet)
Iterates over a DataSet object, adding all the datarecords to the xml feed.
|
org.dom4j.Element |
addElements(java.lang.String name,
java.util.Hashtable subElements)
Creates a new parent Element and appends children to it.
|
void |
addElements(java.lang.String containingTagName,
java.lang.String containingTagText,
DataSet dataSet)
Iterates over a DataSet object, adding all the datarecords to the xml feed.
|
org.dom4j.Element |
addElements(java.lang.String name,
java.lang.String text,
java.util.Hashtable subElements)
Creates a new parent Element and appends children to it.
|
void |
addElements(java.lang.String containingTagName,
java.lang.String containingTagText,
java.util.Hashtable attributes,
DataSet dataSet)
Iterates over a DataSet object, adding all the datarecords to the xml feed.
|
org.dom4j.Element |
addElements(java.lang.String name,
java.lang.String text,
java.util.Hashtable attributes,
java.util.Hashtable subElements)
Creates a new parent Element and appends children to it.
|
void |
close()
Closes all open tags along with the file writer associated with this object.
|
public XmlWriter(java.lang.String fileName, java.lang.String rootElementName) throws java.lang.Exception
fileName
- The file name that we needrootElementName
- The name of the Root Element.java.lang.Exception
- On error creating the writerpublic XmlWriter(java.lang.String fileName, java.lang.String rootElementName, java.lang.String rootElementText) throws java.lang.Exception
fileName
- The file that will contain the XML.rootElementName
- The name of the root element.rootElementText
- Text that belongs inside the root tags.java.lang.Exception
- On error creating the writerpublic XmlWriter(java.lang.String fileName, java.lang.String rootElementName, java.lang.String rootElementText, java.util.Hashtable attributes) throws java.lang.Exception
fileName
- The file that will contain the XML.rootElementName
- The name of the root element.rootElementText
- The text that belongs inside the root tags.attributes
- Any attributes to add to the root element.java.lang.Exception
- On error creating the writerpublic XmlWriter(java.lang.String fileName, java.lang.String rootElementName, java.lang.String rootElementText, java.util.Hashtable attributes, java.lang.String characterSet) throws java.lang.Exception
fileName
- The file that will contain the XML.rootElementName
- The name of the root element.rootElementText
- The text that belongs inside the root tags.attributes
- Any attributes to add to the root element.characterSet
- The character set to use.java.lang.Exception
- On error creating the writerpublic org.dom4j.Element addElement(java.lang.String name) throws java.lang.Exception
name
- The new element's tag name.java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElement(java.lang.String name, java.lang.String text) throws java.lang.Exception
name
- The new Element's tag name.text
- The new Element's inner text.java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElement(java.lang.String name, java.lang.String text, java.util.Hashtable attributes) throws java.lang.Exception
name
- The new Element's tag name.text
- The new Element's inner text.attributes
- A Hashtable of attributes. Attributes will be added to the tag like so: key="value".java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElement(java.lang.String name, java.util.Hashtable attributes) throws java.lang.Exception
name
- The new Element's tag name.attributes
- A Hashtable of attributes. Attributes will be added to the tag like so: key="value".java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElement(org.dom4j.Element elementToAppendTo, java.lang.String name) throws java.lang.Exception
elementToAppendTo
- The element to append information to.name
- The new Element's tag name.java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElement(org.dom4j.Element elementToAppendTo, java.lang.String name, java.lang.String text) throws java.lang.Exception
elementToAppendTo
- The element to append information to.name
- The new Element's tag name.text
- The new Element's inner text.java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElement(org.dom4j.Element elementToAppendTo, java.lang.String name, java.lang.String text, java.util.Hashtable attributes) throws java.lang.Exception
elementToAppendTo
- The element to add information to.name
- The new Element's tag name.text
- The new Element's inner text.attributes
- A Hashtable of attributes. Attributes will be added to the tag like so: key="value".java.lang.Exception
- If there is an error with writing the Element to the file.public org.dom4j.Element addElements(java.lang.String name, java.util.Hashtable subElements) throws java.lang.Exception
name
- The name of the parent element.subElements
- Hashtable of children elements. Children are added to the parent with the tag name as the key and the inner text as the value.java.lang.Exception
- On error adding the elementspublic org.dom4j.Element addElements(org.dom4j.Element elementToAppendTo, java.lang.String name, java.util.Hashtable subElements) throws java.lang.Exception
elementToAppendTo
- The Element to add the new parent Element to.name
- The name of the parent element.subElements
- Hashtable of children elements. Children are added to the parent with the tag name as the key and the inner text as the value.java.lang.Exception
- On error adding the elementspublic org.dom4j.Element addElements(java.lang.String name, java.lang.String text, java.util.Hashtable subElements) throws java.lang.Exception
name
- The name of the parent element.text
- The inner text of the parent Element.subElements
- Hashtable of children elements. Children are added to the parent with the tag name as the key and the inner text as the value.java.lang.Exception
- On error adding the elementspublic org.dom4j.Element addElements(org.dom4j.Element elementToAppendTo, java.lang.String name, java.lang.String text, java.util.Hashtable subElements) throws java.lang.Exception
elementToAppendTo
- The Element to add the new parent Element to.name
- The name of the parent element.text
- The inner text of the parent Element.subElements
- Hashtable of children elements. Children are added to the parent with the tag name as the key and the inner text as the value.java.lang.Exception
- On error adding the elementspublic org.dom4j.Element addElements(java.lang.String name, java.lang.String text, java.util.Hashtable attributes, java.util.Hashtable subElements) throws java.lang.Exception
name
- The name of the parent element.text
- The inner text of the parent Element.attributes
- A Hashtable of attributes. Attributes will be added to the tag like so: key="value".subElements
- Hashtable of children elements. Children are added to the parent with the tag name as the key and the inner text as the value.java.lang.Exception
- On error adding the elementspublic org.dom4j.Element addElements(org.dom4j.Element elementToAppendTo, java.lang.String name, java.lang.String text, java.util.Hashtable attributes, java.util.Hashtable subElements) throws java.lang.Exception
elementToAppendTo
- The element to add the new parent Element to.name
- The tag name of the new parent Element.text
- The inner text of the new parent Element.attributes
- A Hashtable of attributes. Attributes will be added to the tag like so: key="value".subElements
- Hashtable of children elements. Children are added to the parent with the tag name as the key and the inner text as the value.java.lang.Exception
- On error adding the elementspublic void addElements(java.lang.String containingTagName, DataSet dataSet) throws java.lang.Exception
containingTagName
- The tag that will surround every dataRecord.dataSet
- The data set that contains datarecords that are to be written to the xml feed.java.lang.Exception
- On error adding the elementspublic void addElements(java.lang.String containingTagName, java.lang.String containingTagText, DataSet dataSet) throws java.lang.Exception
containingTagName
- The tag that will surround every dataRecord.containingTagText
- The inner text of the tag that surrounds every dataRecord.dataSet
- The data set that contains datarecords that are to be written to the xml feed.java.lang.Exception
- On error adding the elementspublic void addElements(java.lang.String containingTagName, java.lang.String containingTagText, java.util.Hashtable attributes, DataSet dataSet) throws java.lang.Exception
containingTagName
- The tag that will surround every dataRecord.containingTagText
- The inner text of the tag that surrounds every dataRecord.attributes
- A Hashtable of attributes. Attributes will be added to the tag like so: key="value".dataSet
- The data set that contains datarecords that are to be written to the xml feed.java.lang.Exception
- On error adding the elementspublic void close() throws java.lang.Exception
java.lang.Exception
- On error closing the writer