|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mkdoc.sax.AbstractXMLReader
A base class for custom XML readers.
Subclasses should initialise the feature set with the mandatory features for XML namespace and namespace prefix support, which must be mutable.
features.put(NAMESPACES, new Feature()); features.put(PREFIXES, new Feature());
Nested Class Summary | |
protected class |
AbstractXMLReader.Feature
SAX parser feature. |
protected class |
AbstractXMLReader.Property
SAX parser property. |
Field Summary | |
protected org.xml.sax.ContentHandler |
contHandler
A content handler. |
protected org.xml.sax.DTDHandler |
dtdHandler
A DTD handler. |
protected org.xml.sax.ErrorHandler |
errorHandler
An error handler. |
protected java.util.Map |
features
A set of XML parser features. |
static java.lang.String |
NAMESPACES
The XML namespaces feature identifier. |
static java.lang.String |
PREFIXES
The XML namespace prefixes feature identifier. |
protected java.util.Map |
properties
A set of XML parser properties. |
protected org.xml.sax.EntityResolver |
resolver
An entity resolver. |
Constructor Summary | |
AbstractXMLReader()
|
Method Summary | |
org.xml.sax.ContentHandler |
getContentHandler()
Get the content handler. |
org.xml.sax.DTDHandler |
getDTDHandler()
Get the DTD handler. |
org.xml.sax.EntityResolver |
getEntityResolver()
Get the entity resolver. |
org.xml.sax.ErrorHandler |
getErrorHandler()
Get the error handler. |
boolean |
getFeature(java.lang.String name)
Get a parser feature. |
java.lang.Object |
getProperty(java.lang.String name)
Get a parser property. |
void |
parse(java.lang.String systemId)
Parse input from a system ID. |
void |
setContentHandler(org.xml.sax.ContentHandler handler)
Set a content handler. |
void |
setDTDHandler(org.xml.sax.DTDHandler handler)
Set a DTD handler. |
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
Set an entity resolver. |
void |
setErrorHandler(org.xml.sax.ErrorHandler handler)
Set an error handler. |
void |
setFeature(java.lang.String name,
boolean value)
Set a parser feature. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a parser property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.XMLReader |
parse |
Field Detail |
public static final java.lang.String NAMESPACES
public static final java.lang.String PREFIXES
protected java.util.Map features
protected java.util.Map properties
protected org.xml.sax.EntityResolver resolver
protected org.xml.sax.DTDHandler dtdHandler
protected org.xml.sax.ContentHandler contHandler
protected org.xml.sax.ErrorHandler errorHandler
Constructor Detail |
public AbstractXMLReader()
Method Detail |
public final boolean getFeature(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
getFeature
in interface org.xml.sax.XMLReader
name
- A SAX parser feature name
specified by a fully qualified URI.
org.xml.sax.SAXNotRecognizedException
- If the
feature name is not recognised.
org.xml.sax.SAXNotSupportedException
- If the
named feature is not supported.public final void setFeature(java.lang.String name, boolean value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
setFeature
in interface org.xml.sax.XMLReader
name
- A SAX parser feature name
specified by a fully qualified URI.value
- The setting to be assigned to the
named property.
org.xml.sax.SAXNotRecognizedException
- If the
feature name is not recognised.
org.xml.sax.SAXNotSupportedException
- If the
named feature is not supported.public final java.lang.Object getProperty(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
getProperty
in interface org.xml.sax.XMLReader
name
- A SAX parser property name
specified by a fully qualified URI.
org.xml.sax.SAXNotRecognizedException
- If the
property name is not recognised.
org.xml.sax.SAXNotSupportedException
- If the
named property is not supported.public final 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.XMLReader
name
- A SAX parser property name
specified by a fully qualified URI.value
- The setting to be assigned to the
named property.
org.xml.sax.SAXNotRecognizedException
- If the
property name is not recognised.
org.xml.sax.SAXNotSupportedException
- If the
named property is not supported.public final void setEntityResolver(org.xml.sax.EntityResolver resolver)
setEntityResolver
in interface org.xml.sax.XMLReader
resolver
- An EntityResolver
to be used when parsing input.public final org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver
in interface org.xml.sax.XMLReader
EntityResolver
, or
null
if not set.public final void setDTDHandler(org.xml.sax.DTDHandler handler)
setDTDHandler
in interface org.xml.sax.XMLReader
handler
- A DTDHandler
to be used when parsing input.public final org.xml.sax.DTDHandler getDTDHandler()
getDTDHandler
in interface org.xml.sax.XMLReader
DTDHandler
, or
null
if not set.public final void setContentHandler(org.xml.sax.ContentHandler handler)
setContentHandler
in interface org.xml.sax.XMLReader
handler
- A ContentHandler
to be used when parsing input.public final org.xml.sax.ContentHandler getContentHandler()
getContentHandler
in interface org.xml.sax.XMLReader
ContentHandler
, or
null
if not set.public final void setErrorHandler(org.xml.sax.ErrorHandler handler)
setErrorHandler
in interface org.xml.sax.XMLReader
handler
- An ErrorHandler
to be used when parsing input.public final org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler
in interface org.xml.sax.XMLReader
ErrorHandler
, or
null
if not set.public final void parse(java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
parse
in interface org.xml.sax.XMLReader
systemId
- A reference to the source to
parse.
java.io.IOException
- If there is a problem
reading the input source.
org.xml.sax.SAXException
- If an error occurs
parsing the input.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |