oracle.xml.parser.v2

## Class XMLMultiHandler

- java.lang.Object
- - oracle.xml.parser.v2.XMLMultiHandler

All Implemented Interfaces:
  ContentHandler

Direct Known Subclasses:
  XSDValidator

    public class XMLMultiHandler
    extends java.lang.Object
    implements ContentHandler

This utility class allow multiple content handlers registered and send all the events to the registered content handlers.

### Constructor Summary

Constructors
Constructor and Description
`XMLMultiHandler()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addContentHandler(ContentHandler cntHandler)` Add the next level ContentHandler the order in which the handler are called is not defined.
`void` `characters(char[] ch, int start, int length)` Receive notification of character data.
`void` `endDocument()` Receive notification of the end of a document.
`void` `endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)` Receive notification of the end of an element.
`void` `endPrefixMapping(java.lang.String prefix)` End the scope of a prefix-URI mapping.
`ContentHandler[]` `getContentHandlers()` Return the next level of ContentHandlers
`int` `getNumContentHandlers()` Return the number of ContentHandlers
`void` `ignorableWhitespace(char[] ch, int start, int length)` Receive notification of ignorable whitespace in element content.
`void` `processingInstruction(java.lang.String target, java.lang.String data)` Receive notification of a processing instruction.
`boolean` `removeContentHandler(ContentHandler cntHandler)` Remove a content handler
`void` `setDocumentLocator(Locator locator)` Receive an object for locating the origin of SAX document events.
`void` `skippedEntity(java.lang.String name)` Receive notification of a skipped entity.
`void` `startDocument()` Receive notification of the beginning of a document.
`void` `startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts)` Receive notification of the beginning of an element.
`void` `startPrefixMapping(java.lang.String prefix, java.lang.String uri)` Begin the scope of a prefix-URI Namespace mapping.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XMLMultiHandler

    public XMLMultiHandler()

### Method Detail

#### setDocumentLocator

    public void setDocumentLocator(Locator locator)

Receive an object for locating the origin of SAX document events.

Specified by:
  `setDocumentLocator` in interface `ContentHandler`
Parameters:
  `locator` - An object that can return the location of any SAX document event.
See Also:
  `Locator`

#### startDocument

    public void startDocument()
                       throws SAXException

Receive notification of the beginning of a document.

Specified by:
  `startDocument` in interface `ContentHandler`
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.
See Also:
  `endDocument()`

#### endDocument

    public void endDocument()
                     throws SAXException

Receive notification of the end of a document.

Specified by:
  `endDocument` in interface `ContentHandler`
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.
See Also:
  `startDocument()`

#### startPrefixMapping

    public void startPrefixMapping(java.lang.String prefix,
                                   java.lang.String uri)
                            throws SAXException

Begin the scope of a prefix-URI Namespace mapping.

Specified by:
  `startPrefixMapping` in interface `ContentHandler`
Parameters:
  `prefix` - The Namespace prefix being declared.
  `uri` - The Namespace URI the prefix is mapped to.
Throws:
  `SAXException` - The client may throw an exception during processing.
See Also:
  `endPrefixMapping(java.lang.String)`, `startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)`

#### endPrefixMapping

    public void endPrefixMapping(java.lang.String prefix)
                          throws SAXException

End the scope of a prefix-URI mapping.

Specified by:
  `endPrefixMapping` in interface `ContentHandler`
Parameters:
  `prefix` - The prefix that was being mapping.
Throws:
  `SAXException` - The client may throw an exception during processing.
See Also:
  `startPrefixMapping(java.lang.String, java.lang.String)`, `endElement(java.lang.String, java.lang.String, java.lang.String)`

#### startElement

    public void startElement(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String qName,
                             Attributes atts)
                      throws SAXException

Receive notification of the beginning of an element.

Specified by:
  `startElement` in interface `ContentHandler`
Parameters:
  `namespaceURI` - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
  `localName` - The local name (without prefix), or the empty string if Namespace processing is not being performed.
  `qName` - The qualified name (with prefix), or the empty string if qualified names are not available.
  `atts` - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.
See Also:
  `endElement(java.lang.String, java.lang.String, java.lang.String)`, `Attributes`

#### endElement

    public void endElement(java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String qName)
                    throws SAXException

Receive notification of the end of an element.

Specified by:
  `endElement` in interface `ContentHandler`
Parameters:
  `namespaceURI` - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
  `localName` - The local name (without prefix), or the empty string if Namespace processing is not being performed.
  `qName` - The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### characters

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

Receive notification of character data.

Specified by:
  `characters` in interface `ContentHandler`
Parameters:
  `ch` - The characters from the XML document.
  `start` - The start position in the array.
  `length` - The number of characters to read from the array.
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.
See Also:
  `ignorableWhitespace(char[], int, int)`, `Locator`

#### ignorableWhitespace

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

Receive notification of ignorable whitespace in element content.

Specified by:
  `ignorableWhitespace` in interface `ContentHandler`
Parameters:
  `ch` - The characters from the XML document.
  `start` - The start position in the array.
  `length` - The number of characters to read from the array.
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.
See Also:
  `characters(char[], int, int)`

#### processingInstruction

    public void processingInstruction(java.lang.String target,
                                      java.lang.String data)
                               throws SAXException

Receive notification of a processing instruction.

Specified by:
  `processingInstruction` in interface `ContentHandler`
Parameters:
  `target` - The processing instruction target.
  `data` - The processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target.
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### skippedEntity

    public void skippedEntity(java.lang.String name)
                       throws SAXException

Receive notification of a skipped entity.

Specified by:
  `skippedEntity` in interface `ContentHandler`
Parameters:
  `name` - The name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]".
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### addContentHandler

    public void addContentHandler(ContentHandler cntHandler)

Add the next level ContentHandler the order in which the handler are called is not defined.

Parameters:
  `cntHandler` - - ContentHandler

#### getContentHandlers

    public ContentHandler[] getContentHandlers()

Return the next level of ContentHandlers

Returns:
  ContentHandler Array

#### getNumContentHandlers

    public int getNumContentHandlers()

Return the number of ContentHandlers

Returns:
  count of ContentHandler

#### removeContentHandler

    public boolean removeContentHandler(ContentHandler cntHandler)

Remove a content handler

Parameters:
  `cntHandler` - content handler to be removed
Returns:
  boolean TRUE if removed, false if not found

Copyright © 2003, 2020, Oracle and/or its affiliates.