org.gswing.utils.xml
Class XmlWriter

java.lang.Object
  extended by org.gswing.utils.xml.XmlReader
      extended by org.gswing.utils.xml.XmlWriter
Direct Known Subclasses:
DbXmlWriter, ElectionsToXml, PartiesToXml

public class XmlWriter
extends XmlReader

Purpose: Generic XML writer. When an XML writer has been created, use the getDocument() method to get the root document to add elements. When all elements have been added use writeToFile to write data to the XML file.


Constructor Summary
XmlWriter(File file)
          Constructor.
 
Method Summary
 Document getNewDocument()
          Create a new XML document object.
 boolean writeToFile()
          Write XML document to XML file.
 
Methods inherited from class org.gswing.utils.xml.XmlReader
getDocument, getFile, readFromFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlWriter

public XmlWriter(File file)
Constructor.

Parameters:
file - The XML file to read.
Method Detail

writeToFile

public boolean writeToFile()
Write XML document to XML file.

Returns:
True if the file was written successfully.

getNewDocument

public Document getNewDocument()
Create a new XML document object.

Returns:
A new XML document object.


Copyright © 2008. All Rights Reserved.