# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# ParserAdapter

`public class ParserAdapter`
`extends Object` `implements XMLReader, DocumentHandler`

java.lang.Object
↳ | org.xml.sax.helpers.ParserAdapter

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. See http://www.saxproject.org for further information.

This class wraps a SAX1 `Parser` and makes it act as a SAX2 `XMLReader`, with feature, property, and Namespace support. Note that it is not possible to report `skippedEntity` events, since SAX1 does not make that information available.

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

See also:

- `XMLReaderAdapter`
- `XMLReader`
- `Parser`

## Summary

### Public constructors
`ParserAdapter()` Construct a new parser adapter.
`ParserAdapter(Parser parser)` Construct a new parser adapter.

### Public methods
`void` | `characters(char[] ch, int start, int length)` Adapter implementation method; do not call.
`void` | `endDocument()` Adapter implementation method; do not call.
`void` | `endElement(String qName)` Adapter implementation method; do not call.
`ContentHandler` | `getContentHandler()` Return the current content handler.
`DTDHandler` | `getDTDHandler()` Return the current DTD handler.
`EntityResolver` | `getEntityResolver()` Return the current entity resolver.
`ErrorHandler` | `getErrorHandler()` Return the current error handler.
`boolean` | `getFeature(String name)` Check a parser feature flag.
`Object` | `getProperty(String name)` Get a parser property.
`void` | `ignorableWhitespace(char[] ch, int start, int length)` Adapter implementation method; do not call.
`void` | `parse(InputSource input)` Parse an XML document.
`void` | `parse(String systemId)` Parse an XML document.
`void` | `processingInstruction(String target, String data)` Adapter implementation method; do not call.
`void` | `setContentHandler(ContentHandler handler)` Set the content handler.
`void` | `setDTDHandler(DTDHandler handler)` Set the DTD handler.
`void` | `setDocumentLocator(Locator locator)` Adapter implementation method; do not call.
`void` | `setEntityResolver(EntityResolver resolver)` Set the entity resolver.
`void` | `setErrorHandler(ErrorHandler handler)` Set the error handler.
`void` | `setFeature(String name, boolean value)` Set a feature flag for the parser.
`void` | `setProperty(String name, Object value)` Set a parser property.
`void` | `startDocument()` Adapter implementation method; do not call.
`void` | `startElement(String qName, AttributeList qAtts)` Adapter implementation method; do not call.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.
From interface `org.xml.sax.XMLReader`
`abstract ContentHandler` | `getContentHandler()` Return the current content handler.
`abstract DTDHandler` | `getDTDHandler()` Return the current DTD handler.
`abstract EntityResolver` | `getEntityResolver()` Return the current entity resolver.
`abstract ErrorHandler` | `getErrorHandler()` Return the current error handler.
`abstract boolean` | `getFeature(String name)` Look up the value of a feature flag.
`abstract Object` | `getProperty(String name)` Look up the value of a property.
`abstract void` | `parse(InputSource input)` Parse an XML document.
`abstract void` | `parse(String systemId)` Parse an XML document from a system identifier (URI).
`abstract void` | `setContentHandler(ContentHandler handler)` Allow an application to register a content event handler.
`abstract void` | `setDTDHandler(DTDHandler handler)` Allow an application to register a DTD event handler.
`abstract void` | `setEntityResolver(EntityResolver resolver)` Allow an application to register an entity resolver.
`abstract void` | `setErrorHandler(ErrorHandler handler)` Allow an application to register an error event handler.
`abstract void` | `setFeature(String name, boolean value)` Set the value of a feature flag.
`abstract void` | `setProperty(String name, Object value)` Set the value of a property.
From interface `org.xml.sax.DocumentHandler`
`abstract void` | `characters(char[] ch, int start, int length)` Receive notification of character data.
`abstract void` | `endDocument()` Receive notification of the end of a document.
`abstract void` | `endElement(String name)` Receive notification of the end of an element.
`abstract void` | `ignorableWhitespace(char[] ch, int start, int length)` Receive notification of ignorable whitespace in element content.
`abstract void` | `processingInstruction(String target, String data)` Receive notification of a processing instruction.
`abstract void` | `setDocumentLocator(Locator locator)` Receive an object for locating the origin of SAX document events.
`abstract void` | `startDocument()` Receive notification of the beginning of a document.
`abstract void` | `startElement(String name, AttributeList atts)` Receive notification of the beginning of an element.

## Public constructors

### ParserAdapter

    public ParserAdapter ()

Construct a new parser adapter.

Use the "org.xml.sax.parser" property to locate the embedded SAX1 driver.

Throws
`SAXException` | If the embedded driver cannot be instantiated or if the org.xml.sax.parser property is not specified.

### ParserAdapter

    public ParserAdapter (Parser parser)

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` | `Parser`: The SAX1 parser to embed.

Throws
`NullPointerException` | If the parser parameter is null.

## Public methods

### characters

    public void characters (char[] ch,
                    int start,
                    int length)

Adapter implementation method; do not call. Adapt a SAX1 characters event.

Parameters
`ch` | `char`: An array of characters.
`start` | `int`: The starting position in the array.
`length` | `int`: The number of characters to use.

Throws
`SAXException` | The client may raise a processing exception.

See also:

- `DocumentHandler.characters(char[], int, int)`

### endDocument

    public void endDocument ()

Adapter implementation method; do not call. Adapt a SAX1 end document event.

Throws
`SAXException` | The client may raise a processing exception.

See also:

- `DocumentHandler.endDocument()`

### endElement

    public void endElement (String qName)

Adapter implementation method; do not call. Adapt a SAX1 end element event.

Parameters
`qName` | `String`: The qualified (prefixed) name.

Throws
`SAXException` | The client may raise a processing exception.

See also:

- `DocumentHandler.endElement(String)`

### getContentHandler

    public ContentHandler getContentHandler ()

Return the current content handler.

Returns
`ContentHandler` | The current content handler, or null if none was supplied.

See also:

- `XMLReader.getEntityResolver()`

### getDTDHandler

    public DTDHandler getDTDHandler ()

Return the current DTD handler.

Returns
`DTDHandler` | the current DTD handler, or null if none was supplied

See also:

- `XMLReader.getEntityResolver()`

### getEntityResolver

    public EntityResolver getEntityResolver ()

Return the current entity resolver.

Returns
`EntityResolver` | The current entity resolver, or null if none was supplied.

See also:

- `XMLReader.getEntityResolver()`

### getErrorHandler

    public ErrorHandler getErrorHandler ()

Return the current error handler.

Returns
`ErrorHandler` | The current error handler, or null if none was supplied.

See also:

- `XMLReader.getEntityResolver()`

### getFeature

    public boolean getFeature (String name)

Check a parser feature flag.

The only features recognized are namespaces and namespace-prefixes.

Parameters
`name` | `String`: The feature name, as a complete URI.

Returns
`boolean` | The current feature value.

Throws
`SAXNotRecognizedException` | If the feature value can't be assigned or retrieved.
`SAXNotSupportedException` | If the feature is not currently readable.

See also:

- `XMLReader.setFeature(String, boolean)`

### getProperty

    public Object getProperty (String name)

Get a parser property.

No properties are currently recognized.

Parameters
`name` | `String`: The property name.

Returns
`Object` | The property value.

Throws
`SAXNotRecognizedException` | If the property value can't be assigned or retrieved.
`SAXNotSupportedException` | If the property value is not currently readable.

See also:

- `XMLReader.getProperty(String)`

### ignorableWhitespace

    public void ignorableWhitespace (char[] ch,
                    int start,
                    int length)

Adapter implementation method; do not call. Adapt a SAX1 ignorable whitespace event.

Parameters
`ch` | `char`: An array of characters.
`start` | `int`: The starting position in the array.
`length` | `int`: The number of characters to use.

Throws
`SAXException` | The client may raise a processing exception.

See also:

- `DocumentHandler.ignorableWhitespace(char[], int, int)`

### parse

    public void parse (InputSource input)

Parse an XML document.

Parameters
`input` | `InputSource`: An input source for the document.

Throws
`IOException` | If there is a problem reading the raw content of the document.
`SAXException` | If there is a problem processing the document.

See also:

- `parse(java.lang.String)`
- `Parser.parse(org.xml.sax.InputSource)`

### parse

    public void parse (String systemId)

Parse an XML document.

Parameters
`systemId` | `String`: The absolute URL of the document.

Throws
`IOException` | If there is a problem reading the raw content of the document.
`SAXException` | If there is a problem processing the document.

See also:

- `parse(org.xml.sax.InputSource)`
- `Parser.parse(java.lang.String)`

### processingInstruction

    public void processingInstruction (String target,
                    String data)

Adapter implementation method; do not call. Adapt a SAX1 processing instruction event.

Parameters
`target` | `String`: The processing instruction target.
`data` | `String`: The remainder of the processing instruction

Throws
`SAXException` | The client may raise a processing exception.

See also:

- `DocumentHandler.processingInstruction(String, String)`

### setContentHandler

    public void setContentHandler (ContentHandler handler)

Set the content handler.

Parameters
`handler` | `ContentHandler`: the new content handler

See also:

- `XMLReader.setEntityResolver(EntityResolver)`

### setDTDHandler

    public void setDTDHandler (DTDHandler handler)

Set the DTD handler.

Parameters
`handler` | `DTDHandler`: the new DTD handler

See also:

- `XMLReader.setEntityResolver(EntityResolver)`

### setDocumentLocator

    public void setDocumentLocator (Locator locator)

Adapter implementation method; do not call. Adapt a SAX1 document locator event.

Parameters
`locator` | `Locator`: A document locator.

See also:

- `ContentHandler.setDocumentLocator(Locator)`

### setEntityResolver

    public void setEntityResolver (EntityResolver resolver)

Set the entity resolver.

Parameters
`resolver` | `EntityResolver`: The new entity resolver.

See also:

- `XMLReader.setEntityResolver(EntityResolver)`

### setErrorHandler

    public void setErrorHandler (ErrorHandler handler)

Set the error handler.

Parameters
`handler` | `ErrorHandler`: The new error handler.

See also:

- `XMLReader.setEntityResolver(EntityResolver)`

### setFeature

    public void setFeature (String name,
                    boolean value)

Set a feature flag for the parser.

The only features recognized are namespaces and namespace-prefixes.

Parameters
`name` | `String`: The feature name, as a complete URI.
`value` | `boolean`: The requested feature value.

Throws
`SAXNotRecognizedException` | If the feature can't be assigned or retrieved.
`SAXNotSupportedException` | If the feature can't be assigned that value.

See also:

- `XMLReader.setFeature(String, boolean)`

### setProperty

    public void setProperty (String name,
                    Object value)

Set a parser property.

No properties are currently recognized.

Parameters
`name` | `String`: The property name.
`value` | `Object`: The property value.

Throws
`SAXNotRecognizedException` | If the property value can't be assigned or retrieved.
`SAXNotSupportedException` | If the property can't be assigned that value.

See also:

- `XMLReader.setProperty(String, Object)`

### startDocument

    public void startDocument ()

Adapter implementation method; do not call. Adapt a SAX1 start document event.

Throws
`SAXException` | The client may raise a processing exception.

See also:

- `DocumentHandler.startDocument()`

### startElement

    public void startElement (String qName,
                    AttributeList qAtts)

Adapter implementation method; do not call. Adapt a SAX1 startElement event.

If necessary, perform Namespace processing.

Parameters
`qName` | `String`: The qualified (prefixed) name.
`qAtts` | `AttributeList`: The XML attribute list (with qnames).

Throws
`SAXException` | The client may raise a processing exception.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*