net.groboclown.xml.xdstates.v1
Class StateIteratorLoader

java.lang.Object
  |
  +--net.groboclown.xml.xdstates.v1.StateIteratorLoader

public class StateIteratorLoader
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 StateIteratorLoader s_instance
           
 
Constructor Summary
protected StateIteratorLoader()
          Default constructor - protected since this is a utility class.
 
Method Summary
 IStateIterator getFromFile(String resourceFile)
           
 IStateIterator getFromResource(String resourceName)
          Get the resource from a classpath resource.
 IStateIterator getFromStream(IInputStreamGenerator isg, String systemID)
           
 IStateIterator getFromURL(String resourceURL)
           
 StateIteratorHandler getHandlerFromStream(IInputStreamGenerator isg, String systemID)
           
static StateIteratorLoader getInstance()
           
protected  XMLReader getXMLReader()
           
 void readHandler(StateIteratorHandler handler, IInputStreamGenerator isg, String systemID)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

s_instance

protected static StateIteratorLoader s_instance
Constructor Detail

StateIteratorLoader

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

getInstance

public static StateIteratorLoader getInstance()

getFromResource

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

getFromFile

public IStateIterator getFromFile(String resourceFile)
                           throws IOException,
                                  SAXException

getFromURL

public IStateIterator getFromURL(String resourceURL)
                          throws IOException,
                                 SAXException

getFromStream

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

readHandler

public void readHandler(StateIteratorHandler handler,
                        IInputStreamGenerator isg,
                        String systemID)
                 throws IOException,
                        SAXException

getHandlerFromStream

public StateIteratorHandler getHandlerFromStream(IInputStreamGenerator isg,
                                                 String systemID)
                                          throws IOException,
                                                 SAXException

getXMLReader

protected XMLReader getXMLReader()
                          throws SAXException


Written under the LGPL