net.groboclown.xml.xdstates.v1.impl
Class StateIteratorHandler
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--net.groboclown.xml.xdstates.v1.impl.StateIteratorHandler
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
- public class StateIteratorHandler
- extends DefaultHandler
This class handles the loading of IXMLResource instances from an
XML file. You can define a resource in the XML document by associating
the "class" attribute with each tag. Its value specifies which
class is used to instantiate the instance. Also, you may specify the
"jarURL" attribute to tell the handler in which jar file the class definition
can be found. If no jarURL attribute is given, then the class is loaded
from the default class loader.
If no class is specified, then the tag is loaded as a DefaultXMLResource
instance.
- Version:
- Alpha 0.9.0 - JDK 1.2+
- Author:
- Matt Albrecht
Method Summary |
void |
characters(char[] ch,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(String uri,
String localName,
String rawName)
|
void |
endPrefixMapping(String prefix)
|
IItem |
getRoot()
Call this method after XML parsing has completed, and everything went
ok. |
StateIteratorX |
getStateIterator()
|
InputSource |
resolveEntity(String publicId,
String systemId)
Allow the application to resolve external entities. |
void |
setAttributeMap(IAttributeMap am)
|
void |
setDocumentLocator(Locator locator)
|
void |
setSetBuilderMap(ISetBuilderMap sbm)
|
void |
startDocument()
|
void |
startElement(String uri,
String localName,
String rawName,
Attributes attributes)
|
void |
startPrefixMapping(String prefix,
String uri)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
m_locator
private Locator m_locator
m_nodeStack
private Stack m_nodeStack
m_root
private IItem m_root
m_systemId
private String m_systemId
m_isg
private IInputStreamGenerator m_isg
m_attrMap
private IAttributeMap m_attrMap
m_sbMap
private ISetBuilderMap m_sbMap
StateIteratorHandler
public StateIteratorHandler(IInputStreamGenerator isg,
String systemId)
- Specify the system id and InputStream loader.
StateIteratorHandler
public StateIteratorHandler(IInputStreamGenerator isg,
String systemId,
IAttributeMap am,
ISetBuilderMap sbm)
- Specify the system id and InputStream loader.
setAttributeMap
public void setAttributeMap(IAttributeMap am)
setSetBuilderMap
public void setSetBuilderMap(ISetBuilderMap sbm)
getRoot
public IItem getRoot()
- Call this method after XML parsing has completed, and everything went
ok.
getStateIterator
public StateIteratorX getStateIterator()
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Overrides:
setDocumentLocator
in class DefaultHandler
startDocument
public void startDocument()
- Overrides:
startDocument
in class DefaultHandler
endDocument
public void endDocument()
throws SAXException
- Overrides:
endDocument
in class DefaultHandler
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
- Overrides:
startPrefixMapping
in class DefaultHandler
endPrefixMapping
public void endPrefixMapping(String prefix)
throws SAXException
- Overrides:
endPrefixMapping
in class DefaultHandler
startElement
public void startElement(String uri,
String localName,
String rawName,
Attributes attributes)
throws SAXException
- Overrides:
startElement
in class DefaultHandler
endElement
public void endElement(String uri,
String localName,
String rawName)
throws SAXException
- Overrides:
endElement
in class DefaultHandler
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
- Overrides:
characters
in class DefaultHandler
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
throws SAXException
- Allow the application to resolve external entities.
The Parser will call this method before opening any external entity
except the top-level document entity (including the external DTD
subset, external entities referenced within the DTD, and external
entities referenced within the document element): the application
may request that the parser resolve the entity itself, that it use
an alternative URI, or that it use an entirely different input source.
Application writers can use this method to redirect external system
identifiers to secure and/or local URIs, to look up public identifiers
in a catalogue, or to read an entity from a database or other input
source (including, for example, a dialog box).
If the system identifier is a URL, the SAX parser must resolve it
fully before reporting it to the application.
- Overrides:
resolveEntity
in class DefaultHandler
- Parameters:
publicId
- The public identifier of the external entity being
referenced, or null if none was supplied.systemId
- The system identifier of the external entity being
referenced.- Returns:
- An InputSource object describing the new input source, or
null to request that the parser open a regular URI
connection to the system identifier.
Written under the LGPL