com.softwareag.tamino.db.api.response.stream
Class TStreamElementDefaultHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.softwareag.tamino.db.api.objectModel.sax.TSAXElementDefaultHandler
          extended by com.softwareag.tamino.db.api.response.stream.TStreamElementDefaultHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler

public class TStreamElementDefaultHandler
extends TSAXElementDefaultHandler
implements org.xml.sax.ext.LexicalHandler

TStreamElementDefaultHandler is an implementation for the abstract class TSAXElementDefaultHandler. It is responsible to process all default handler specific events that are thrown for the query content when the stream based object model is in use.

Version:
$Revision: 1.9 $
Author:
Marcus Schreyer

Field Summary
 
Fields inherited from class com.softwareag.tamino.db.api.objectModel.sax.TSAXElementDefaultHandler
SPECIFIER
 
Constructor Summary
TStreamElementDefaultHandler(TStreamWritingDeclHandler elementDeclHandler, TStreamWritingLexicalHandler elementLexicalHandler)
          Initializes the instance.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character content for a specific element.
 void clear()
          Clears the current given internal parsing state so that a new SAX parsing can be initiated.
 void comment(char[] ch, int start, int length)
          Report an XML comment anywhere in the document.
 void endCDATA()
          Report the end of a CDATA section.
 void endDTD()
          Report the end of DTD declarations.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          Receive notification of the ending of an element.
 void endEntity(java.lang.String name)
          Report the end of an entity.
 void endPrefixMapping(java.lang.String prefix)
          Receive notification of the end of prefix mapping for an element.
 java.util.Iterator<TStreamElement> getElementIterator()
          Returns an iterator that can be used to navigate over the sequence of TSAXElement instances that might have been build due to the event handling.
 TSAXElement getFirstElement()
          Returns the first element within the sequence of TSAXElement instances that might have been build due to the event handling.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Receive notification for a processing instruction.
 void startCDATA()
          Report the start of a CDATA section.
 void startDocument()
          Receive notification for the start of a new document.
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Report the start of DTD declarations, if any.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Receive notification of the beginning of an element.
 void startEntity(java.lang.String name)
          Report the beginning of an entity in content.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Receive notification of the start of prefix mapping for an element.
 
Methods inherited from class com.softwareag.tamino.db.api.objectModel.sax.TSAXElementDefaultHandler
reset
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TStreamElementDefaultHandler

public TStreamElementDefaultHandler(TStreamWritingDeclHandler elementDeclHandler,
                                    TStreamWritingLexicalHandler elementLexicalHandler)
Initializes the instance.

Method Detail

getFirstElement

public TSAXElement getFirstElement()
Returns the first element within the sequence of TSAXElement instances that might have been build due to the event handling.

Specified by:
getFirstElement in class TSAXElementDefaultHandler
Returns:
TSAXElement instance if one is given, null otherwise.

getElementIterator

public java.util.Iterator<TStreamElement> getElementIterator()
Returns an iterator that can be used to navigate over the sequence of TSAXElement instances that might have been build due to the event handling.

Specified by:
getElementIterator in class TSAXElementDefaultHandler
Returns:
java.util.Iterator if one is given, null otherwise.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Receive notification for the start of a new document.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Receive notification for a processing instruction. The given processing instruction is written to the current given character output stream.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Receive notification of the beginning of an element. The given element is written to the to the current given character output stream.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Receive notification of the ending of an element. End of element is written to character output stream.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Receive notification of the start of prefix mapping for an element. Identified namespaces are added in a hashmap in order to form namespace uris of an element while serializing it.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Receive notification of the end of prefix mapping for an element.

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
endPrefixMapping in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Receive notification of character content for a specific element. Element content is written to character output stream.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws org.xml.sax.SAXException
Report an XML comment anywhere in the document.

Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

startCDATA

public void startCDATA()
                throws org.xml.sax.SAXException
Report the start of a CDATA section. This is will be called by lexical hndlers.

Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Report the end of a CDATA section. This is will be called by lexical hndlers.

Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
Report the start of DTD declarations, if any.

Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

endDTD

public void endDTD()
            throws org.xml.sax.SAXException
Report the end of DTD declarations.

Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

endEntity

public void endEntity(java.lang.String name)
               throws org.xml.sax.SAXException
Report the end of an entity.

Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

startEntity

public void startEntity(java.lang.String name)
                 throws org.xml.sax.SAXException
Report the beginning of an entity in content.

Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException

clear

public void clear()
Clears the current given internal parsing state so that a new SAX parsing can be initiated.



Copyright (c) 2013 Software AG. All Rights Reserved.