public class SAXReader
extends java.lang.Object
implements org.xml.sax.XMLReader
It is written for to be small, fast and SAX 2 compliant.
Other Parsers will all be stronger in one of these areas, so if you need only one: small, speed or SAX 2 compliant you can probably do better.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SAXReader.Position
an inner class to track the position within the document
with.
|
| Modifier and Type | Field and Description |
|---|---|
protected static int |
INTERNAL |
protected static int |
SYSTEM |
| Constructor and Description |
|---|
SAXReader() |
| Modifier and Type | Method and Description |
|---|---|
org.xml.sax.ContentHandler |
getContentHandler()
get the content handler for this parser
|
org.xml.sax.DTDHandler |
getDTDHandler()
get the dtd for this parser
|
org.xml.sax.EntityResolver |
getEntityResolver()
get the entity resolver for this parser
|
org.xml.sax.ErrorHandler |
getErrorHandler() |
boolean |
getFeature(java.lang.String name) |
protected org.xml.sax.Locator |
getLocator()
return the current position of the reader within the document
|
java.lang.Object |
getProperty(java.lang.String name) |
void |
parse(org.xml.sax.InputSource is)
Main parse function
|
void |
parse(java.lang.String systemId)
Main parse function
|
void |
setContentHandler(org.xml.sax.ContentHandler handler)
set the ContentHandler.
|
void |
setDTDHandler(org.xml.sax.DTDHandler dtd)
sets the DTD Handler (this option is not implemented yet)
|
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
sets the EntityResolver (this option is not implemented yet)
|
void |
setErrorHandler(org.xml.sax.ErrorHandler e_handler)
set the ErrorHandler (this option is not implemented yet)
|
void |
setFeature(java.lang.String name,
boolean value) |
void |
setProperty(java.lang.String name,
java.lang.Object value) |
protected static final int SYSTEM
protected static final int INTERNAL
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
setEntityResolver in interface org.xml.sax.XMLReaderXMLReader.setEntityResolver(EntityResolver)public void setDTDHandler(org.xml.sax.DTDHandler dtd)
setDTDHandler in interface org.xml.sax.XMLReaderXMLReader.setDTDHandler(DTDHandler)public void setContentHandler(org.xml.sax.ContentHandler handler)
setContentHandler in interface org.xml.sax.XMLReaderXMLReader.setContentHandler(ContentHandler)public void setErrorHandler(org.xml.sax.ErrorHandler e_handler)
setErrorHandler in interface org.xml.sax.XMLReaderXMLReader.setErrorHandler(ErrorHandler)public org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler in interface org.xml.sax.XMLReaderpublic void parse(org.xml.sax.InputSource is)
throws org.xml.sax.SAXException,
java.io.IOException
parse in interface org.xml.sax.XMLReaderorg.xml.sax.SAXExceptionjava.io.IOExceptionXMLReader.parse(InputSource)public void parse(java.lang.String systemId)
throws org.xml.sax.SAXException,
java.io.IOException
parse in interface org.xml.sax.XMLReaderorg.xml.sax.SAXExceptionjava.io.IOExceptionXMLReader.parse(String)protected org.xml.sax.Locator getLocator()
Easiest way to use is just call toString() on position to have a printable format for the position
SAXReader.Positionpublic org.xml.sax.ContentHandler getContentHandler()
getContentHandler in interface org.xml.sax.XMLReaderpublic org.xml.sax.DTDHandler getDTDHandler()
getDTDHandler in interface org.xml.sax.XMLReaderpublic org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver in interface org.xml.sax.XMLReaderpublic boolean getFeature(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
getFeature in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedExceptionpublic java.lang.Object getProperty(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
getProperty in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedExceptionpublic void setFeature(java.lang.String name,
boolean value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
setFeature in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedExceptionpublic void setProperty(java.lang.String name,
java.lang.Object value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
setProperty in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedExceptionorg.xml.sax.SAXNotSupportedException