Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber()
This class is only used internally so this method should never
be called.
|
ContentHandler |
getContentHandler()
Return the current content handler.
|
DTDHandler |
getDTDHandler()
This class is only used internally so this method should never
be called.
|
EntityResolver |
getEntityResolver()
This class is only used internally so this method should never
be called.
|
ErrorHandler |
getErrorHandler()
This class is only used internally so this method should never
be called.
|
boolean |
getFeature(java.lang.String name)
This class is only used internally so this method should never
be called.
|
int |
getLineNumber()
This class is only used internally so this method should never
be called.
|
java.lang.Object |
getProperty(java.lang.String name)
This class is only used internally so this method should never
be called.
|
java.lang.String |
getPublicId()
This class is only used internally so this method should never
be called.
|
java.lang.String |
getSystemId()
This class is only used internally so this method should never
be called.
|
void |
parse() |
void |
parse(InputSource unused)
Parse an XML document.
|
void |
parse(java.lang.String sysId)
This class is only used internally so this method should never
be called.
|
void |
setContentHandler(ContentHandler handler)
Allow an application to register a content event handler.
|
void |
setDTDHandler(DTDHandler handler)
This class is only used internally so this method should never
be called.
|
void |
setEntityResolver(EntityResolver resolver)
This class is only used internally so this method should never
be called.
|
void |
setErrorHandler(ErrorHandler handler)
This class is only used internally so this method should never
be called.
|
void |
setFeature(java.lang.String name,
boolean value)
This class is only used internally so this method should never
be called.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
This class is only used internally so this method should never
be called.
|
public DOM2SAX(Node root)
public ContentHandler getContentHandler()
XMLReader
getContentHandler
in interface XMLReader
XMLReader.setContentHandler(org.xml.sax.ContentHandler)
public void setContentHandler(ContentHandler handler) throws java.lang.NullPointerException
XMLReader
If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
setContentHandler
in interface XMLReader
handler
- The content handler.java.lang.NullPointerException
XMLReader.getContentHandler()
public void parse(InputSource unused) throws java.io.IOException, SAXException
XMLReader
The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).
Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same XMLReader object, possibly with a different input source. Configuration of the XMLReader object (such as handler bindings and values established for feature flags and properties) is unchanged by completion of a parse, unless the definition of that aspect of the configuration explicitly specifies other behavior. (For example, feature flags or properties exposing characteristics of the document being parsed.)
During the parse, the XMLReader will provide information about the XML document through the registered event handlers.
This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.
parse
in interface XMLReader
unused
- The input source for the top-level of the
XML document.java.io.IOException
- An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.SAXException
- Any SAX exception, possibly
wrapping another exception.InputSource
,
XMLReader.parse(java.lang.String)
,
XMLReader.setEntityResolver(org.xml.sax.EntityResolver)
,
XMLReader.setDTDHandler(org.xml.sax.DTDHandler)
,
XMLReader.setContentHandler(org.xml.sax.ContentHandler)
,
XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)
public void parse() throws java.io.IOException, SAXException
java.io.IOException
SAXException
public DTDHandler getDTDHandler()
getDTDHandler
in interface XMLReader
XMLReader.setDTDHandler(org.xml.sax.DTDHandler)
public ErrorHandler getErrorHandler()
getErrorHandler
in interface XMLReader
XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)
public boolean getFeature(java.lang.String name) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature
in interface XMLReader
name
- The feature name, which is a fully-qualified URI.SAXNotRecognizedException
- If the feature
value can't be assigned or retrieved.SAXNotSupportedException
- When the
XMLReader recognizes the feature name but
cannot determine its value at this time.XMLReader.setFeature(java.lang.String, boolean)
public void setFeature(java.lang.String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature
in interface XMLReader
name
- The feature name, which is a fully-qualified URI.value
- The requested value of the feature (true or false).SAXNotRecognizedException
- If the feature
value can't be assigned or retrieved.SAXNotSupportedException
- When the
XMLReader recognizes the feature name but
cannot set the requested value.XMLReader.getFeature(java.lang.String)
public void parse(java.lang.String sysId) throws java.io.IOException, SAXException
parse
in interface XMLReader
sysId
- The system identifier (URI).java.io.IOException
- An IO exception from the parser,
possibly from a byte stream or character stream
supplied by the application.SAXException
- Any SAX exception, possibly
wrapping another exception.XMLReader.parse(org.xml.sax.InputSource)
public void setDTDHandler(DTDHandler handler) throws java.lang.NullPointerException
setDTDHandler
in interface XMLReader
handler
- The DTD handler.java.lang.NullPointerException
XMLReader.getDTDHandler()
public void setEntityResolver(EntityResolver resolver) throws java.lang.NullPointerException
setEntityResolver
in interface XMLReader
resolver
- The entity resolver.java.lang.NullPointerException
XMLReader.getEntityResolver()
public EntityResolver getEntityResolver()
getEntityResolver
in interface XMLReader
XMLReader.setEntityResolver(org.xml.sax.EntityResolver)
public void setErrorHandler(ErrorHandler handler) throws java.lang.NullPointerException
setErrorHandler
in interface XMLReader
handler
- The error handler.java.lang.NullPointerException
XMLReader.getErrorHandler()
public void setProperty(java.lang.String name, java.lang.Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty
in interface XMLReader
name
- The property name, which is a fully-qualified URI.value
- The requested value for the property.SAXNotRecognizedException
- If the property
value can't be assigned or retrieved.SAXNotSupportedException
- When the
XMLReader recognizes the property name but
cannot set the requested value.public java.lang.Object getProperty(java.lang.String name) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty
in interface XMLReader
name
- The property name, which is a fully-qualified URI.SAXNotRecognizedException
- If the property
value can't be assigned or retrieved.SAXNotSupportedException
- When the
XMLReader recognizes the property name but
cannot determine its value at this time.XMLReader.setProperty(java.lang.String, java.lang.Object)
public int getColumnNumber()
getColumnNumber
in interface Locator
Locator.getLineNumber()
public int getLineNumber()
getLineNumber
in interface Locator
Locator.getColumnNumber()
public java.lang.String getPublicId()
getPublicId
in interface Locator
Locator.getSystemId()
public java.lang.String getSystemId()
getSystemId
in interface Locator
Locator.getPublicId()
Copyright © 2014 Apache XML Project. All Rights Reserved.