oracle.xml.comp

## Class CXMLHandlerBase

- java.lang.Object
- - org.xml.sax.HandlerBase
  - - oracle.xml.parser.v2.DefaultXMLDocumentHandler
    - - oracle.xml.comp.CXMLHandlerBase

All Implemented Interfaces:
  XMLDocumentHandler, ContentHandler, DocumentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

    public class CXMLHandlerBase
    extends DefaultXMLDocumentHandler
    implements ContentHandler, LexicalHandler

The SAX compression is implemented using SAX Handler which compresses the data based on SAX events. To use the SAX compression, the application needs to implement this interface and register with the SAX parser via `Parser.setDocumentHandler()`

### Constructor Summary

Constructors
Constructor and Description
`CXMLHandlerBase()` Default Constructor
`CXMLHandlerBase(java.io.ObjectOutput outstream)` Constructs the CXMLHandlerBase using the `ObjectOutput` Stream

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `characters(char[] cbuf, int start, int len)` Receive notification of character data inside an element
`void` `comment(char[] ch, int start, int length)` Receive notification of comment The parser will invoke this method for each comment found.
`void` `comment(java.lang.String text)` Receive notification of comment The parser will invoke this method for each comment found.
`void` `endCDATA()` Receive notification of end of CDATA
`void` `endDoctype()` Receive notification of end of the DTD.
`void` `endDocument()` Receive notification of the end of the document.
`void` `endDTD()` Receive notification of end of DTD declaration
`void` `endElement(NSName elem)` Deprecated. this is replaced by endElement(namespace, localName, qname)
`void` `endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)` Deprecated. this is replaced by endElement(namespace, localName, qname)
`void` `endEntity(java.lang.String name)` Receive notification of end of entity
`void` `endPrefixMapping(java.lang.String prefix)` Receive notification of the end of scope of prefix URI mapping
`XMLDocumentHandler` `getHandler()` Get the next pipe-line node handler.
`InfosetWriter` `getInfosetWriter()` Get the CXMLWriter
`java.lang.Object` `getProperty(java.lang.String name)` Look up the value of a property.
`void` `ignorableWhitespace(char[] cbuf, int start, int len)` Receive notification of ignorable whitespace in element content
`void` `processingInstruction(java.lang.String target, java.lang.String data)` Receive notification of a processing instruction
`void` `setDoctype(DTD dtd)` Receive notification of a DTD (Document Type node).
`void` `setDocumentLocator(Locator locator)` Receive the Locator object for the document event.
`void` `setError(XMLError he)` Receive notification of a XMLError handler.
`void` `setHandler(XMLDocumentHandler h)` Receive notification of a next pipe-line node handler.
`void` `setProperty(java.lang.String name, java.lang.Object value)` Set the value of a property.
`void` `setPSVI(boolean val)` Set flag to store PSVI information
`void` `setTextDecl(java.lang.String version, java.lang.String encoding)` Receive notification of a Text XML Declaration.
`void` `setXMLSchema(java.lang.Object s)` Receive notification of a XMLSchema object.
`void` `setXSDValidator(XSDValidator sv)` Set the XSDValidator used to retrieve PSVI info
`void` `startCDATA()` Receive notification of start of CDATA
`void` `startDocument()` Receive notification of the begining of the document.
`void` `startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)` Receive notification of start of DTD declaratoin
`void` `startElement(NSName elem, SAXAttrList attributes)` Recieve notification of the begining of an element.
`void` `startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes attributes)` Recieve notification of the begining of an element.
`void` `startEntity(java.lang.String name)` Receive notification of begininning of some internal or external XML entities
`void` `startPrefixMapping(java.lang.String prefix, java.lang.String uri)` Receive notification of the begin the scope of prefix URI mapping.

### Methods inherited from class oracle.xml.parser.v2.DefaultXMLDocumentHandler

`cDATASection, setXMLDecl, skippedEntity`

### Methods inherited from class org.xml.sax.HandlerBase

`endElement, error, fatalError, notationDecl, resolveEntity, startElement, unparsedEntityDecl, warning`

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

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

### Methods inherited from interface org.xml.sax.ContentHandler

`skippedEntity`

### Methods inherited from interface org.xml.sax.DocumentHandler

`endElement, startElement`

### Constructor Detail

#### CXMLHandlerBase

    public CXMLHandlerBase(java.io.ObjectOutput outstream)
                    throws java.io.IOException

Constructs the CXMLHandlerBase using the `ObjectOutput` Stream

Parameters:
  `out` - the output stream
Throws:
  `java.io.IOException`

#### CXMLHandlerBase

    public CXMLHandlerBase()

Default Constructor

### Method Detail

#### getInfosetWriter

    public InfosetWriter getInfosetWriter()

Get the CXMLWriter

#### getProperty

    public java.lang.Object getProperty(java.lang.String name)

Look up the value of a property. The property name is any fully-qualified URI.

Parameters:
  `name` - The property name, which is a fully-qualified URI.
Returns:
  The current value of the property.
See Also:
  `setProperty(java.lang.String, java.lang.Object)`

#### setProperty

    public void setProperty(java.lang.String name,
                            java.lang.Object value)

Set the value of a property. The property name is any fully-qualified URI.

Parameters:
  `name` - The property name, which is a fully-qualified URI.
  `value` - The requested value for the property.

#### setXSDValidator

    public void setXSDValidator(XSDValidator sv)

Set the XSDValidator used to retrieve PSVI info

Parameters:
  `sv` - validator

#### setPSVI

    public void setPSVI(boolean val)

Set flag to store PSVI information

Parameters:
  `val` -

#### setDocumentLocator

    public void setDocumentLocator(Locator locator)

Receive the Locator object for the document event. By default, do nothing. This method could be overridden by the subclasses events.

Specified by:
  `setDocumentLocator` in interface `ContentHandler`
Specified by:
  `setDocumentLocator` in interface `DocumentHandler`
Overrides:
  `setDocumentLocator` in class `HandlerBase`
Parameters:
  `locator` - The locator for the SAX document events.
See Also:
  `ContentHandler.setDocumentLocator(org.xml.sax.Locator)`

#### startDocument

    public void startDocument()
                       throws SAXException

Receive notification of the begining of the document. By default, do nothing. This method could be overridden by the subclasses to take specific actions at the begining of a document.

Specified by:
  `startDocument` in interface `ContentHandler`
Specified by:
  `startDocument` in interface `DocumentHandler`
Overrides:
  `startDocument` in class `HandlerBase`
Parameters:
  `none` -
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.
See Also:
  `DocumentHandler.startDocument()`

#### endDocument

    public void endDocument()
                     throws SAXException

Receive notification of the end of the document.

Specified by:
  `endDocument` in interface `ContentHandler`
Specified by:
  `endDocument` in interface `DocumentHandler`
Overrides:
  `endDocument` in class `HandlerBase`
Parameters:
  `none` -
Throws:
  `SAXException`
See Also:
  `DocumentHandler.endDocument()`

#### startPrefixMapping

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

Receive notification of the begin the scope of prefix URI mapping.

Specified by:
  `startPrefixMapping` in interface `ContentHandler`
Overrides:
  `startPrefixMapping` in class `DefaultXMLDocumentHandler`
Parameters:
  `prefix` - The Namespace prefix being declared
  `uri` - The Namespace URI the prefix is mapped to
Throws:
  `SAXException`
See Also:
  `DefaultXMLDocumentHandler.endPrefixMapping(java.lang.String)`, `DefaultXMLDocumentHandler.startElement(oracle.xml.parser.v2.NSName, oracle.xml.parser.v2.SAXAttrList)`

#### endPrefixMapping

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

Receive notification of the end of scope of prefix URI mapping

Specified by:
  `endPrefixMapping` in interface `ContentHandler`
Overrides:
  `endPrefixMapping` in class `DefaultXMLDocumentHandler`
Parameters:
  `prefix` - The prefix that was being mapped
Throws:
  `SAXException`
See Also:
  `DefaultXMLDocumentHandler.startPrefixMapping(java.lang.String, java.lang.String)`, `DefaultXMLDocumentHandler.endElement(oracle.xml.parser.v2.NSName)`

#### startElement

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

Recieve notification of the begining of an element.

Specified by:
  `startElement` in interface `ContentHandler`
Overrides:
  `startElement` in class `DefaultXMLDocumentHandler`
Parameters:
  `namespaceURI` - The Namespace URI, or empty string if the element has NamespaceUri
  `localName` - The local name (without prefix)
  `qName` - The qualified name (with prefix)
  `atts` - The attributes attached to the element. If there are no attributes, then it is an empty Attribute object
Throws:
  `SAXException`
See Also:
  `DefaultXMLDocumentHandler.endElement(oracle.xml.parser.v2.NSName)`, `Attributes`

#### endElement

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

Deprecated. this is replaced by endElement(namespace, localName, qname)
Receive notification of the end of the element.

Specified by:
  `endElement` in interface `ContentHandler`
Overrides:
  `endElement` in class `DefaultXMLDocumentHandler`
Parameters:
  `namespaceURI` - The namespace URI or empty string if there is no namespace UIR
  `localName` - The local name (without prefix)
  `qName` - The qualified XML 1.0 name (with prefix)
Throws:
  `SAXException`

#### characters

    public void characters(char[] cbuf,
                           int start,
                           int len)
                    throws SAXException

Receive notification of character data inside an element

Specified by:
  `characters` in interface `ContentHandler`
Specified by:
  `characters` in interface `DocumentHandler`
Overrides:
  `characters` in class `HandlerBase`
Parameters:
  `cbuf` - characters
  `start` - The starting position in the character array
  `length` - The number of characters to us from the character array
Throws:
  `SAXException`
See Also:
  `DocumentHandler.characters(char[], int, int)`

#### ignorableWhitespace

    public void ignorableWhitespace(char[] cbuf,
                                    int start,
                                    int len)
                             throws SAXException

Receive notification of ignorable whitespace in element content

Specified by:
  `ignorableWhitespace` in interface `ContentHandler`
Specified by:
  `ignorableWhitespace` in interface `DocumentHandler`
Overrides:
  `ignorableWhitespace` in class `HandlerBase`
Parameters:
  `ch` - The Character from XML docuemnt
  `start` - The start position in the array.
  `length` - The number of characters to read from the array
Throws:
  `SAXException`
See Also:
  `DocumentHandler.ignorableWhitespace(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`
Specified by:
  `processingInstruction` in interface `DocumentHandler`
Overrides:
  `processingInstruction` in class `HandlerBase`
Parameters:
  `target` - The processing instruction target
  `data` - The processing instruction data
Throws:
  `SAXException`
See Also:
  `DocumentHandler.processingInstruction(java.lang.String, java.lang.String)`

#### startDTD

    public void startDTD(java.lang.String name,
                         java.lang.String publicId,
                         java.lang.String systemId)
                  throws SAXException

Receive notification of start of DTD declaratoin

Specified by:
  `startDTD` in interface `LexicalHandler`
Parameters:
  `name` - The document type name
  `publicId` - The declared public identifier for the external DTD subset, or null if none was declared
  `systemId` - The declared system identifier for the externa DTD subset, or null if none was declared
Throws:
  `SAXException`
See Also:
  `LexicalHandler.endDTD()`, `LexicalHandler.startEntity(java.lang.String)`

#### endDTD

    public void endDTD()
                throws SAXException

Receive notification of end of DTD declaration

Specified by:
  `endDTD` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)`

#### startEntity

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

Receive notification of begininning of some internal or external XML entities

Specified by:
  `startEntity` in interface `LexicalHandler`
Parameters:
  `name` - The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is an external DTD subset it will be "[dtd]"
Throws:
  `SAXException`
See Also:
  `LexicalHandler.endEntity(java.lang.String)`, `DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)`, `DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)`

#### endEntity

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

Receive notification of end of entity

Specified by:
  `endEntity` in interface `LexicalHandler`
Parameters:
  `name` - The name of the entity
Throws:
  `SAXException`
See Also:
  `LexicalHandler.startEntity(java.lang.String)`

#### startCDATA

    public void startCDATA()
                    throws SAXException

Receive notification of start of CDATA

Specified by:
  `startCDATA` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.endCDATA()`

#### endCDATA

    public void endCDATA()
                  throws SAXException

Receive notification of end of CDATA

Specified by:
  `endCDATA` in interface `LexicalHandler`
Throws:
  `SAXException`
See Also:
  `LexicalHandler.startCDATA()`

#### comment

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

Receive notification of comment

The parser will invoke this method for each comment found.

Specified by:
  `comment` in interface `LexicalHandler`
Parameters:
  `ch` - The comment character data
  `start` - The starting location of the comment
  `length` - The length of the comment character data
Throws:
  `SAXException` - Any SAX exception possibly wrapping another exception

#### startElement

    public void startElement(NSName elem,
                             SAXAttrList attributes)
                      throws SAXException

Recieve notification of the begining of an element.

Specified by:
  `startElement` in interface `XMLDocumentHandler`
Overrides:
  `startElement` in class `DefaultXMLDocumentHandler`
Parameters:
  `namespaceURI` - The Namespace URI, or empty string if the element has NamespaceUri
  `elem` - The NSName of the element
  `attributes` - The attributes attached to the element. If there are no attributes, then it is an empty Attribute object
Throws:
  `SAXException`
See Also:
  `DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)`

#### endElement

    public void endElement(NSName elem)
                    throws SAXException

Deprecated. this is replaced by endElement(namespace, localName, qname)
Receive notification of the end of the element.

Specified by:
  `endElement` in interface `XMLDocumentHandler`
Overrides:
  `endElement` in class `DefaultXMLDocumentHandler`
Parameters:
  `elem` - The NSName of the element.
Throws:
  `SAXException`
See Also:
  `DocumentHandler.endElement(java.lang.String)`

#### setTextDecl

    public void setTextDecl(java.lang.String version,
                            java.lang.String encoding)
                     throws SAXException

Receive notification of a Text XML Declaration.

The Parser will invoke this method once for each text XML Decl

Specified by:
  `setTextDecl` in interface `XMLDocumentHandler`
Overrides:
  `setTextDecl` in class `DefaultXMLDocumentHandler`
Parameters:
  `version` - The version number (or null, if not specified)
  `encoding` - The encoding name
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### comment

    public void comment(java.lang.String text)
                 throws SAXException

Receive notification of comment

The parser will invoke this method for each comment found.

Specified by:
  `comment` in interface `XMLDocumentHandler`
Overrides:
  `comment` in class `DefaultXMLDocumentHandler`
Parameters:
  `ch` - The comment character data
  `start` - The starting location of the comment
  `length` - The length of the comment character data
Throws:
  `SAXException` - Any SAX exception possibly wrapping another exception

#### setHandler

    public void setHandler(XMLDocumentHandler h)
                    throws SAXException

Receive notification of a next pipe-line node handler.

Specified by:
  `setHandler` in interface `XMLDocumentHandler`
Overrides:
  `setHandler` in class `DefaultXMLDocumentHandler`
Parameters:
  `h` - The XMLDocumentHandler node
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### getHandler

    public XMLDocumentHandler getHandler()

Get the next pipe-line node handler.

Specified by:
  `getHandler` in interface `XMLDocumentHandler`
Overrides:
  `getHandler` in class `DefaultXMLDocumentHandler`
Returns:
  The XMLDocumentHandler node

#### setError

    public void setError(XMLError he)
                  throws SAXException

Receive notification of a XMLError handler.

Specified by:
  `setError` in interface `XMLDocumentHandler`
Overrides:
  `setError` in class `DefaultXMLDocumentHandler`
Parameters:
  `he` - The XMLError object
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### setXMLSchema

    public void setXMLSchema(java.lang.Object s)
                      throws SAXException

Receive notification of a XMLSchema object.

Specified by:
  `setXMLSchema` in interface `XMLDocumentHandler`
Overrides:
  `setXMLSchema` in class `DefaultXMLDocumentHandler`
Parameters:
  `s` - The XMLSchema object
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### setDoctype

    public void setDoctype(DTD dtd)
                    throws SAXException

Receive notification of a DTD (Document Type node).

The Parser will invoke this method after calling startDocument to register the DTD used.

Specified by:
  `setDoctype` in interface `XMLDocumentHandler`
Overrides:
  `setDoctype` in class `DefaultXMLDocumentHandler`
Parameters:
  `DTD` - The DTD node
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

#### endDoctype

    public void endDoctype()
                    throws SAXException

Receive notification of end of the DTD.

Specified by:
  `endDoctype` in interface `XMLDocumentHandler`
Overrides:
  `endDoctype` in class `DefaultXMLDocumentHandler`
Throws:
  `SAXException` - Any SAX exception, possibly wrapping another exception.

Copyright © 2003, 2017, Oracle and/or its affiliates. All rights reserved.