org.gswing.utils.xml
Class XmlReader

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

public class XmlReader
extends Object

Purpose: Generic XML reader.


Constructor Summary
XmlReader(File file)
          Constructor.
 
Method Summary
 Document getDocument()
          Get the XML document object.
protected  File getFile()
          Get the XML file object.
 boolean readFromFile(boolean raiseError)
          Read the XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlReader

public XmlReader(File file)
Constructor.

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

readFromFile

public boolean readFromFile(boolean raiseError)
Read the XML file. If the specified file doesn't exist a new document will be created.

Parameters:
raiseError - If true this method will raise an error containing the exception if an exception occurrs reading the file.
Returns:
True if the document is read successfully.

getDocument

public Document getDocument()
Get the XML document object.

Returns:
The XML document.

getFile

protected File getFile()
Get the XML file object.

Returns:
the XML file object.


Copyright © 2008. All Rights Reserved.