|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.xml.xerces.XercesXMLStream
This class wraps an implementation of the SAX 2 event-based XML
parser to create a spiderlogic-specific interface. Any changes or deprecations
in event-based parsers in the future can be accounted for within this class.
This class is used to open an xml file and get callbacks, through the
XMLHandler
as the file is parsed. To do this,
this class extends the base SAX event handler class and passes each event
on to the SpiderLogic XMLHandler, scrubbing out any SAX-specific classes.
Constructor Summary | |
XercesXMLStream()
Create an XML stream parser with callbacks to a handler. |
Method Summary | |
protected Map |
buildMap(org.xml.sax.Attributes attributes)
Used to convert the SAX-specific (@link Attributes} set into a Hashtable. |
void |
characters(char[] buffer,
int start,
int length)
called by SAX2 parser whenever non-tag characters are encountered. |
void |
endDocument()
called by SAX2 parser when the end of the document is encountered. |
void |
endElement(String namespaceURL,
String localName,
String qname)
called by SAX2 parser when the end of an element is encountered. |
void |
endPrefixMapping(String p0)
|
void |
error(org.xml.sax.SAXParseException spe)
called by SAX2 parser when a recoverable parse error is encountered |
void |
fatalError(org.xml.sax.SAXParseException spe)
called by SAX2 parser when a non-recoverable parse error is encountered. |
void |
ignorableWhitespace(char[] p0,
int p1,
int p2)
|
void |
notationDecl(String p0,
String p1,
String p2)
|
void |
parse()
Begins parsing of the XML file specified in constructor, with callbacks going to the specified handler. |
void |
processingInstruction(String p0,
String p1)
|
void |
setDocumentLocator(org.xml.sax.Locator p0)
|
void |
setHandler(XMLHandler aHandler)
Set the handler that will receive callbacks during parsing. |
void |
setReader(Reader aFileReader)
Set a Reader which has been opened on the data to parse. |
void |
skippedEntity(String p0)
|
void |
startDocument()
called by SAX2 parser at the start of the document. |
void |
startElement(String namespaceURI,
String localName,
String qname,
org.xml.sax.Attributes attributes)
called by SAX2 parser when the start of a new element is encountered. |
void |
startPrefixMapping(String p0,
String p1)
|
void |
unparsedEntityDecl(String p0,
String p1,
String p2,
String p3)
|
void |
warning(org.xml.sax.SAXParseException spe)
called by SAX2 parser when warning situation is encountered |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XercesXMLStream()
XMLStream.parse()
is called.
Method Detail |
public void setReader(Reader aFileReader)
setReader
in interface XMLStream
aFileReader
- The stream upon which to read the data to parse.public void setHandler(XMLHandler aHandler)
setHandler
in interface XMLStream
aHandler
- The handler that will be called back during parsing.public void parse() throws XMLException
parse
in interface XMLStream
XMLException
- If the data stream cannot be parsed.public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
public void characters(char[] buffer, int start, int length)
characters
in interface org.xml.sax.ContentHandler
buffer
- the set of characters containing the detected non-tag characters.start
- the starting index of the detected characers inside bufferlength
- length of detected character set, starting at index startpublic void error(org.xml.sax.SAXParseException spe)
error
in interface org.xml.sax.ErrorHandler
spe
- describes the error and gives its location in the file.public void fatalError(org.xml.sax.SAXParseException spe)
fatalError
in interface org.xml.sax.ErrorHandler
spe
- describes the error and gives its location in the file.public void warning(org.xml.sax.SAXParseException spe)
warning
in interface org.xml.sax.ErrorHandler
spe
- describes the error and gives its location in the file.public void startElement(String namespaceURI, String localName, String qname, org.xml.sax.Attributes attributes)
startElement
in interface org.xml.sax.ContentHandler
namespaceURI
- see http://www.megginson.com/SAX/Java/javadoc/index.htmllocalName
- see http://www.megginson.com/SAX/Java/javadoc/index.htmlqname
- see http://www.megginson.com/SAX/Java/javadoc/index.htmlattributes
- the set of attributes and values contained in this element tag.public void endElement(String namespaceURL, String localName, String qname)
endElement
in interface org.xml.sax.ContentHandler
localName
- see http://www.megginson.com/SAX/Java/javadoc/index.htmlqname
- see http://www.megginson.com/SAX/Java/javadoc/index.htmlpublic void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
public void endPrefixMapping(String p0) throws org.xml.sax.SAXException
endPrefixMapping
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void ignorableWhitespace(char[] p0, int p1, int p2) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void notationDecl(String p0, String p1, String p2) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void processingInstruction(String p0, String p1) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void setDocumentLocator(org.xml.sax.Locator p0)
setDocumentLocator
in interface org.xml.sax.ContentHandler
public void skippedEntity(String p0) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void startPrefixMapping(String p0, String p1) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException
public void unparsedEntityDecl(String p0, String p1, String p2, String p3) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected Map buildMap(org.xml.sax.Attributes attributes)
attributes
- attribute set to convert to a hashtable.
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |