oracle.xml.comp
Class CXMLHandlerBase

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

public class CXMLHandlerBase
extends DefaultXMLDocumentHandler
implements XMLDocumentHandler, ContentHandler, CXMLConstants

This interface extends the org.xml.sax.ContentHandler interface. SAX Applications requiring binary compression support need to implement this interface and register with the SAX Parser via Parser.setDocumentHandler().


Fields inherited from interface oracle.xml.comp.CXMLConstants
ATTR_DEF, ATTR_TOKEN, ATTRDECL_DEF, CDATA_DEF, CHAR_DEF, COMMENT_DEF, CXML_VERSION, cXMLFILE, cXMLFILE_LEN, DEBUG, DTD_DEF, ELEMENTDECL_DEF, END, ENTITY_DEF, ENTITYREF_DEF, META_ID_MAX, names, NOTATION_DEF, NS_DEF, NULLSTR, PI_DEF, PREFIX_DEF, TAG_DEF, TAG_TOKEN, TOKEN_ONLY, XMLDECL_DEF
 
Constructor Summary
CXMLHandlerBase()
           
CXMLHandlerBase(java.io.ObjectOutput outstream)
          Constructs the default CXMLHandlerBase.
CXMLHandlerBase(oracle.xml.io.XMLObjectOutput out)
          Constructs the default CXMLHandlerBase.
 
Method Summary
TypeMethod
 void cDATASection(char[] cbuf, int start, int len)
          Receive notification of a CDATA Section.
 void characters(char[] cbuf, int start, int len)
          Receive notification of character data inside an element
 void comment(java.lang.String text)
          Receive notification of a comment.
 void endDoctype()
          Receive notification of end of the DTD.
 void endDocument()
          Receive notification of the end of the document.
 void endElement(NSName elem)
          Receive notification of the end of the element.
 void endPrefixMapping(java.lang.String prefix)
          Receive notification of the end of scope of prefix URI mapping
 oracle.xml.comp.CXMLContext getCXMLContext()
          Return the CXML Context used for compression
 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 setProperty(java.lang.String name, java.lang.Object value)
          Set the value of a property.
 void setTextDecl(java.lang.String version, java.lang.String encoding)
          Receive notification of a Text XML Declaration.
 void setXMLDecl(java.lang.String version, java.lang.String standalone, java.lang.String encoding)
          Receive notification of a XML Declaration
 void setXMLSchema(java.lang.Object s)
          Receive notification of a XMLSchema object.
 void skippedEntity(java.lang.String name)
          Receive notification of a skipped entity.
 void startDocument()
          Receive notification of the begining of the document.
 void startElement(NSName elem, SAXAttrList attributes)
          Recieve notification of the begining of an element.
 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
endElement, getHandler, setHandler, startElement
 
Methods inherited from class org.xml.sax.HandlerBase
endElement, error, fatalError, notationDecl, resolveEntity, startElement, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CXMLHandlerBase

public CXMLHandlerBase(java.io.ObjectOutput outstream)
                throws java.io.IOException
Constructs the default CXMLHandlerBase.
Parameters:
arg - The name of the input XML file

CXMLHandlerBase

public CXMLHandlerBase(oracle.xml.io.XMLObjectOutput out)
Constructs the default CXMLHandlerBase.
Parameters:
arg - The name of the input XML file

CXMLHandlerBase

public CXMLHandlerBase()
Method Detail

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.

getCXMLContext

public oracle.xml.comp.CXMLContext getCXMLContext()
Return the CXML Context used for compression
Returns:
CXMLContext

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
Overrides:
setDocumentLocator in class HandlerBase
Parameters:
locator - The locator for the SAX document events.
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)

setXMLDecl

public void setXMLDecl(java.lang.String version,
                       java.lang.String standalone,
                       java.lang.String encoding)
                throws SAXException
Receive notification of a XML Declaration

The Parser will invoke this method once for XML Decl

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

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
Overrides:
startDocument in class HandlerBase
Parameters:
none -  

endDocument

public void endDocument()
                 throws SAXException
Receive notification of the end of the document.
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class HandlerBase
Parameters:
none -  
Throws:
SAXException -  

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 -  

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 -  

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws SAXException
Receive notification of a skipped entity.

The Parser will invoke this method once for each entity skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the http://xml.org/sax/features/external-general-entities and the http://xml.org/sax/features/external-parameter-entities properties.

Specified by:
skippedEntity in interface ContentHandler
Overrides:
skippedEntity in class DefaultXMLDocumentHandler
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.

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
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 -  

endElement

public void endElement(NSName elem)
                throws SAXException
Receive notification of the end of the element.
Specified by:
endElement in interface XMLDocumentHandler
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
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 -  

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
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 -  

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
Overrides:
processingInstruction in class HandlerBase
Parameters:
target - The processing instruction target
data - The processing instruction data
Throws:
SAXException -  

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.

cDATASection

public void cDATASection(char[] cbuf,
                         int start,
                         int len)
                  throws SAXException
Receive notification of a CDATA Section.

The Parser will invoke this method once for each CDATA Section found.

Specified by:
cDATASection in interface XMLDocumentHandler
Overrides:
cDATASection in class DefaultXMLDocumentHandler
Parameters:
ch - The CDATA section characters.
start - The start position in the character array.
length - The number of characters to use from the character array.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

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 a comment.

The Parser will invoke this method once for each comment found: note that comment may occur before or after the main document element.

Specified by:
comment in interface XMLDocumentHandler
Overrides:
comment in class DefaultXMLDocumentHandler
Parameters:
data - The comment data, or null if none was supplied.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

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.