com.softwareag.tamino.db.api.objectModel.sax
Class TSAXObjectModel

java.lang.Object
  extended by com.softwareag.tamino.db.api.objectModel.TXMLObjectModel
      extended by com.softwareag.tamino.db.api.objectModel.sax.TSAXObjectModel
Direct Known Subclasses:
TStreamInputStreamInterpreter.StreamBasedSAXObjectModel

public class TSAXObjectModel
extends TXMLObjectModel

TSAXObjectModel represents the SAX object model. This class is used when creating accessor instances. An accessor is always created for a specific object model. The factory methods for creating an accessor take an instance of an object model class. You can use the constructor of the TSAXObjectModel class for this purpose.

Specifying the SAX object model for an accessor determines that the XML documents provided by that accessor are streams of SAX events.

The processing of a stream of SAX events requires a set of handlers, which are triggered by the SAX parser. When constructing a TSAXObjectModel instance these handlers must be specified.

Version:
$Revision: 1.15 $
Author:
Marcus Schreyer

Constructor Summary
TSAXObjectModel(java.lang.String specifier, java.lang.Class saxDocumentClass, java.lang.Class saxElementClass, TSAXDocumentDefaultHandler documentDefaultHandler, TSAXElementDefaultHandler elementDefaultHandler)
          Constructor to create a new instance of the SAX object model.
 
Method Summary
 void setDeclHandler(org.xml.sax.ext.DeclHandler declHandler)
          Sets an optional SAX declaration handler for this model.
 void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler)
          Sets an optional SAX lexical handler for this model.
 
Methods inherited from class com.softwareag.tamino.db.api.objectModel.TXMLObjectModel
deregister, getAdapterClass, getAdapterConstructor, getDocumentClass, getElementClass, getInputStreamInterpreterClass, getLocale, getProperty, getPropertyIterator, getPropertyKeyIterator, getRegisteredModel, getRegisteredModel, getRegisteredModels, getSpecifier, isRegistered, register, setLocale, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TSAXObjectModel

public TSAXObjectModel(java.lang.String specifier,
                       java.lang.Class saxDocumentClass,
                       java.lang.Class saxElementClass,
                       TSAXDocumentDefaultHandler documentDefaultHandler,
                       TSAXElementDefaultHandler elementDefaultHandler)
Constructor to create a new instance of the SAX object model. It is important to know whether a SAX object model instance is to be used for processing query results or single XML documents (either programmatically instantiated or retrieved from Tamino) or both. For the processing of query results a saxElementClass and a elementDefaultHandler are required. If only single XML documents are retrieved from Tamino (via the accessor retrieve method) or if single XML documents are created (via a TXMLObject newInstance factory method), a saxDocumentClass and a documentDefaultHandler are required. If both possibilities are required all 4 parameters need to be set.

A SAX object model is primarily intended for reading XML documents from Tamino. If the storing and updating of XML documents is required as well, the handler and document/element classes need to provide an implementation that allows this.

Parameters:
specifier - a string identifying this SAX object model instance. As it is possible to instantiate more than one instance, each instance must have a different specifier.
saxDocumentClass - a class implementing the TSAXDocument interface. This parameter is required if the documentDefaultHandler parameter is not null, otherwise null is allowed. This parameter must be set if single XML documents are either retrieved from Tamino or are created as TXMLObject instances.
saxElementClass - a class implementing the TSAXElement interface. This parameter is required if the elementDefaultHandler parameter is not null, otherwise null is allowed. This parameter must be set if XML documents resulting from a Tamino query are to be processed.
documentDefaultHandler - an instance of a class extending the TSAXDocumentDefaultHandler abstract class. This parameter is optional, but required if single XML documents are either retrieved from Tamino or are created as TXMLObject instances. If this parameter is specified, the saxDocumentClass parameter must also be set.
elementDefaultHandler - an instance of a class extending the TSAXElementDefaultHandler abstract class. This parameter is optional, but required if XML documents resulting from a Tamino query are to be processed. If this parameter is specified, the saxElementClass parameter must also be set.
Method Detail

setDeclHandler

public void setDeclHandler(org.xml.sax.ext.DeclHandler declHandler)
Sets an optional SAX declaration handler for this model. The declaration handler given must implement the SAX DeclHandler interface. A declaration handler handles to provide information about DTD declarations in an XML document.

Parameters:
declHandler - an instance of a class implementing the SAX DeclHandler interface.

setLexicalHandler

public void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexicalHandler)
Sets an optional SAX lexical handler for this model. The dlexical handler given must implement the SAX LexicalHandler interface. A lexical handler handles to provide lexical information about an XML document, such as comments and CDATA section boundaries.

Parameters:
lexicalHandler - an instance of a class implementing the SAX LexicalHandler interface.


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