Google

Xerces 3.1.1 API: Class ParserAdapter
Xerces 3.1.1


Class ParserAdapter

java.lang.Object
  |

Adapt a SAX1 Parser as a SAX2 XMLReader.

This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.
with feature, property, and Namespace support. Note

This adapter does not test for duplicate Namespace-qualified attribute names.

Since:
SAX 2.0
Version:
2.0


          Construct a new parser adapter.
          Construct a new parser adapter.
Constructor Summary
  int start, int length)
          Adapt a SAX1 characters event.
          Adapt a SAX1 end document event.
          Adapt a SAX1 end element event.
          Check a parser feature.
          Get a parser property. int start, int length)
          Adapt a SAX1 ignorable whitespace event.
          Parse an XML document.
          Parse an XML document. java.lang.String data)
          Adapt a SAX1 processing instruction event.
          Set the content handler.
          Adapt a SAX1 document locator event.
          Set the DTD handler.
          Set the entity resolver.
          Set the error handler. boolean state)
          Set a feature for the parser. java.lang.Object value)
          Set a parser property.
          Adapt a SAX1 start document event.
          Adapt a SAX1 startElement event.
Method Summary
 void
 void
 void

          Return the current content handler.

          Return the current DTD handler.

          Return the current entity resolver.

          Return the current error handler.
 boolean
 java.lang.Object
 void
 void
 void
 void
 void
 void
 void
 void
 void
 void
 void
 void
 void
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserAdapter

public ParserAdapter()
Construct a new parser adapter. embedded SAX1 driver.

cannot be instantiated or if the

ParserAdapter
Construct a new parser adapter.

Note that the embedded parser cannot be changed once the adapter is created; to embed a different parser, allocate a new ParserAdapter.

Parameters:
parser - The SAX1 parser to embed.
Throws:
java.lang.NullPointerException - If the parser parameter is null.
Method Detail

setFeature

public void setFeature(java.lang.String name,
                       boolean state)
Set a feature for the parser.

The only features supported are namespaces and namespace-prefixes.


getFeature

public boolean getFeature(java.lang.String name)
Check a parser feature.

The only features supported are namespaces and namespace-prefixes.


setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Set a parser property.

No special properties are currently supported.


getProperty

public java.lang.Object getProperty(java.lang.String name)
Get a parser property.

No special properties are currently supported.


setEntityResolver
Set the entity resolver.
Parameters:
resolver - The new entity resolver.
Throws:
java.lang.NullPointerException - If the entity resolver

getEntityResolver

Return the current entity resolver.

setDTDHandler
Set the DTD handler.
Parameters:
resolver - The new DTD handler.
Throws:
java.lang.NullPointerException - If the DTD handler

getDTDHandler

Return the current DTD handler.

setContentHandler
Set the content handler.
Parameters:
resolver - The new content handler.
Throws:
java.lang.NullPointerException - If the content handler

getContentHandler

Return the current content handler.

setErrorHandler
Set the error handler.
Parameters:
resolver - The new error handler.
Throws:
java.lang.NullPointerException - If the error handler

getErrorHandler

Return the current error handler.

parse

public void parse(java.lang.String systemId)
           throws java.io.IOException,
Parse an XML document.
Parameters:
systemId - The absolute URL of the document.
Throws:
java.io.IOException - If there is a problem reading

parse
           throws java.io.IOException,
Parse an XML document.
Parameters:
input - An input source for the document.
Throws:
java.io.IOException - If there is a problem reading

setDocumentLocator
Adapt a SAX1 document locator event.

startDocument

public void startDocument()
Adapt a SAX1 start document event.

endDocument

public void endDocument()
Adapt a SAX1 end document event.

startElement
public void startElement(java.lang.String qName,
Adapt a SAX1 startElement event.

If necessary, perform Namespace processing.

Parameters:
qName - The qualified (prefixed) name.
qAtts - The XML 1.0 attribute list (with qnames).

endElement

public void endElement(java.lang.String qName)
Adapt a SAX1 end element event.

characters

public void characters(char[] ch,
                       int start,
                       int length)
Adapt a SAX1 characters event.

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Adapt a SAX1 ignorable whitespace event.

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
Adapt a SAX1 processing instruction event.

Xerces 3.1.1