at.woli.xml
Class XMLFileReader

java.lang.Object
  extended by at.woli.xml.XMLFileReader

public class XMLFileReader
extends Object

XMLFileReader reads a XML file and pare it into an XMlData object.

Version:
1.0.0
Author:
Wolfgang Nitzlnader

Field Summary
private  Document document
           
private  SAXReader reader
           
private  XMLData xmlFileData
          XMLData Object which stores all elements and attributes
private  String xmlFilePath
          Path of the XML file
 
Constructor Summary
XMLFileReader()
          Standard constructor all variables are initialized with 0
XMLFileReader(String xmlFilePath)
          Constructor which initialize a new XMLData Object and sets the xmlFilePath with the given parameter
 
Method Summary
 XMLData getXmlFileData()
          Returns a XMLData Object which stores all elements and attributes
 String getXmlFilePath()
          Returns the actual Path, where the XML file will be saved
 XMLData parseXMlFile()
          Parse the XML file and stores all elements and attributes in a XMLData object

Befor you can parse an XML file, you have read the XML file
 XMLData readAndParseXMLFile()
          Read a parse a XML file
 XMLData readAndParseXMLFile(String xmlFilePath)
          Read and parse a XML file at the given path
 void readXMLFile()
          Reads the XML file
 void readXMLFile(String xmlFilePath)
          Reads the XML file and uses the file at the given parameter
 void setXmlFileData(XMLData xmlFileData)
          Sets the given paramante as the actual XMLData object
 void setXmlFilePath(String xmlFilePath)
          Stets the path for the XML file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlFileData

private XMLData xmlFileData
XMLData Object which stores all elements and attributes


xmlFilePath

private String xmlFilePath
Path of the XML file


reader

private SAXReader reader

document

private Document document
Constructor Detail

XMLFileReader

public XMLFileReader()
Standard constructor all variables are initialized with 0


XMLFileReader

public XMLFileReader(String xmlFilePath)
Constructor which initialize a new XMLData Object and sets the xmlFilePath with the given parameter

Parameters:
xmlFilePath - The path of the XML file which will be read and parse by the class
Method Detail

getXmlFileData

public XMLData getXmlFileData()
Returns a XMLData Object which stores all elements and attributes

Returns:
the list of elements

setXmlFileData

public void setXmlFileData(XMLData xmlFileData)
Sets the given paramante as the actual XMLData object

Parameters:
xmlFileData - A XMlData Object which store all elements and attributes

getXmlFilePath

public String getXmlFilePath()
Returns the actual Path, where the XML file will be saved

Returns:
the actual Path of the XML file

setXmlFilePath

public void setXmlFilePath(String xmlFilePath)
Stets the path for the XML file

Parameters:
xmlFilePath - Path of the XML file

readXMLFile

public void readXMLFile()
Reads the XML file


readXMLFile

public void readXMLFile(String xmlFilePath)
Reads the XML file and uses the file at the given parameter

Parameters:
xmlFilePath - Path of the XML file

parseXMlFile

public XMLData parseXMlFile()
Parse the XML file and stores all elements and attributes in a XMLData object

Befor you can parse an XML file, you have read the XML file

Returns:
A list of all elements and attributes
See Also:
readXMLFile(), readXMLFile(String), readAndParseXMLFile(String), readAndParseXMLFile()

readAndParseXMLFile

public XMLData readAndParseXMLFile()
Read a parse a XML file

Returns:
a list of all elements and attributes

readAndParseXMLFile

public XMLData readAndParseXMLFile(String xmlFilePath)
Read and parse a XML file at the given path

Parameters:
xmlFilePath - Path of the XMl file
Returns:
a list of all elements and attributes