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:
- xml4j:
net.groboclown.util.xmlresource.v1.xml4j.GetXMLReader
(requires xml4j.jar and sax2.jar in the classpath)
- xerces:
net.groboclown.util.xmlresource.v1.xerces.GetXMLReader
(requires a 1.2.1 compatible build of xerces.jar)
- Version:
- Alpha 0.9.0 - xml4j + sax2
- Author:
- Matt Albrecht
- See Also:
XMLResourceHandler
Constructor Summary |
protected |
XMLResourceLoader()
Default constructor - protected since this is a
utility class. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
g_xmlLoader
protected static XMLResourceLoader g_xmlLoader
XMLResourceLoader
protected XMLResourceLoader()
- Default constructor - protected since this is a
utility class.
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