net.groboclown.xml.resource.v1
Class XMLResourceLoader

java.lang.Object
  |
  +--net.groboclown.xml.resource.v1.XMLResourceLoader

public class XMLResourceLoader
extends Object

A utility class which invokes the XML parser to extract the IXMLResource instances from the XML file.

Depending on which XML library you have, you will want to specify which XMLReader creator to use. Specify the class which implements the IGetXMLReader interface with the -D option of:

      net.groboclown.util.xmlresource.v1.XMLReaderClass=<class name>
 
where class name is the name of the class which will read in the XMLReader. The default class is the Xerces reader. Default supported implementations are:

Version:
Alpha 0.9.0 - xml4j + sax2
Author:
Matt Albrecht
See Also:
XMLResourceHandler

Field Summary
protected static XMLResourceLoader g_xmlLoader
           
 
Constructor Summary
protected XMLResourceLoader()
          Default constructor - protected since this is a utility class.
 
Method Summary
 IXMLResource getFromFile(String resourceFile)
           
 IXMLResource getFromResource(String resourceName)
          Get the resource from a classpath resource.
 IXMLResource getFromStream(IInputStreamGenerator isg, String systemID)
           
 IXMLResource getFromURL(String resourceURL)
           
static XMLResourceLoader getInstance()
           
protected  XMLReader getXMLReader()
           
 void setGetXMLReader(String className)
          Sets the XMLReader getter.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

g_xmlLoader

protected static XMLResourceLoader g_xmlLoader
Constructor Detail

XMLResourceLoader

protected XMLResourceLoader()
Default constructor - protected since this is a utility class.
Method Detail

getInstance

public static XMLResourceLoader getInstance()

setGetXMLReader

public void setGetXMLReader(String className)
Sets the XMLReader getter. This will override any current settings.

getFromResource

public IXMLResource getFromResource(String resourceName)
                             throws IOException,
                                    SAXException
Get the resource from a classpath resource.

getFromFile

public IXMLResource getFromFile(String resourceFile)
                         throws IOException,
                                SAXException

getFromURL

public IXMLResource getFromURL(String resourceURL)
                        throws IOException,
                               SAXException

getFromStream

public IXMLResource getFromStream(IInputStreamGenerator isg,
                                  String systemID)
                           throws IOException,
                                  SAXException

getXMLReader

protected XMLReader getXMLReader()
                          throws SAXException


Written under the LGPL