tuwien.auto.calimero.xml
Class XMLFactory

java.lang.Object
  extended by tuwien.auto.calimero.xml.XMLFactory

public final class XMLFactory
extends java.lang.Object

Creates XML reader and XML writer for working with XML resources.

A XMLWriter and XMLReader is created using its default constructor, i.e. every implementation is required to supply such a constructor.
By default, the factory creates instances of types located in the def sub package.
The factory uses an EntityResolver to resolve XML resources.

Note that for now only one default XML reader/writer is available in this factory, and therefore can't be changed.


Method Summary
 XMLReader createXMLReader(java.lang.String systemID)
          Creates a XMLReader to read the XML resource located by the specified identifier.
 XMLWriter createXMLWriter(java.lang.String systemID)
          Creates a XMLWriter to write into the XML resource located by the specified identifier.
static XMLFactory getInstance()
          Gets the XML factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createXMLReader

public XMLReader createXMLReader(java.lang.String systemID)
                          throws KNXMLException
Creates a XMLReader to read the XML resource located by the specified identifier.

On closing the created XML reader, the Reader set as input for the XML reader will get closed as well.

Parameters:
systemID - location identifier of the XML resource
Returns:
XML reader
Throws:
KNXMLException - if creation of the reader failed or XML resource can't be resolved

createXMLWriter

public XMLWriter createXMLWriter(java.lang.String systemID)
                          throws KNXMLException
Creates a XMLWriter to write into the XML resource located by the specified identifier.

Parameters:
systemID - location identifier of the XML resource
Returns:
XML writer
Throws:
KNXMLException - if creation of the writer failed or XML resource can't be resolved

getInstance

public static XMLFactory getInstance()
Gets the XML factory.

Returns:
XMLFactory object