Arch4J 1.1

org.arch4j.xml
Class XMLProvider

java.lang.Object
  |
  +--org.arch4j.xml.XMLProvider

public class XMLProvider
extends Object

This class is the main provider for xml services. The services are accessed via the static getProvider() method.

As an example of access to the services:

 String fileName = "file.xml";
 FileReader reader = new FileReader(fileName);
 XMLStream stream = XMLProvider.getProvider().getXMLStream(reader, this);
 

Version:
1.0
Author:
Ross Greinke

Field Summary
protected  String DEFAULT_XML_STREAM_CLASS
          The fallback XML stream implementation.
protected  String XML_DOMAIN
          The XML domain property file name.
protected  String XML_STREAM_CLASS_PROPERTY
          The XML stream implementation class property name.
 
Constructor Summary
protected XMLProvider()
          This is made protected so the only way to access this class is through the getProvider method.
 
Method Summary
protected  Object createInstance(Class aClass)
          Create an instance from the Class.
static XMLProvider getProvider()
          Returns the singleton instance of this class.
 XMLStream getXMLStream(Reader characterStream, XMLHandler callbackHandler)
          Returns a reference to a new XMLStream implementation.
protected  Class getXMLStreamClass()
          Get the XML stream implementation class to use from the property setting.
static void resetProvider()
          Remove the single instance of the XMLProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_DOMAIN

protected final String XML_DOMAIN
The XML domain property file name.

See Also:
Constant Field Values

XML_STREAM_CLASS_PROPERTY

protected final String XML_STREAM_CLASS_PROPERTY
The XML stream implementation class property name.

See Also:
Constant Field Values

DEFAULT_XML_STREAM_CLASS

protected final String DEFAULT_XML_STREAM_CLASS
The fallback XML stream implementation.

See Also:
Constant Field Values
Constructor Detail

XMLProvider

protected XMLProvider()
This is made protected so the only way to access this class is through the getProvider method.

Method Detail

getProvider

public static XMLProvider getProvider()
Returns the singleton instance of this class.


resetProvider

public static void resetProvider()
Remove the single instance of the XMLProvider.


getXMLStream

public XMLStream getXMLStream(Reader characterStream,
                              XMLHandler callbackHandler)
Returns a reference to a new XMLStream implementation.

Parameters:
characterStream - The source data.
callbackHandler - The class that handles events found while parsing.
Returns:
A reference to a new XMLStream implementation.

getXMLStreamClass

protected Class getXMLStreamClass()
Get the XML stream implementation class to use from the property setting.

Returns:
the XML stream implementation as a Class.
Throws:
EnvironmentalException - if unable to retrieve the classname property or associate a Class object with the classname.

createInstance

protected Object createInstance(Class aClass)
Create an instance from the Class.

Throws:
EnvironmentalException - if fails to create a new instance of the Class.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.