com.softwareag.tamino.db.api.objectModel.sax
Interface TSAXDocument


public interface TSAXDocument

TSAXDocument interface represents a single XML document. You must provide a class that implements this interface when using a SAX object model and intend to use the SAX object model to process single XML objects. Single XML objects are either returned by Tamino via a retrieve method of an accessor or are instantiated using one of the newInstance factory methods of the TXMLObject class.

The class implementing the TSAXDocument interface works in close relationship with a TSAXDocumentDefaulthandler implementation. This class handles the SAX events and normally produces an instance of the associated TSAXDocument class. The class implementing the TSAXDocument interface also determines the type of objects returned by the getDocument method of TXMLObject instances of the SAX object model in question.

This interface only defines a method to access the document root element and one to serialize the entire document representation into a character output stream.

Version:
$Revision: 1.4 $
Author:
Marcus Schreyer

Method Summary
 TSAXElement getRootElement()
          Gets the document root element as a TSAXElement instance.
 void writeTo(java.io.Writer writer)
          Serializes the document content as a character output stream into the given writer.
 

Method Detail

getRootElement

TSAXElement getRootElement()
Gets the document root element as a TSAXElement instance. An implementation of this method is not always required. If no meaningful implementation exists, null may be returned. This would the case in which the processing of the SAX events does not result in a tree structure containing elements.

Returns:
a TSAXElement instance representing the document root element, null if no such element exists.

writeTo

void writeTo(java.io.Writer writer)
Serializes the document content as a character output stream into the given writer. A meaninful implementation of this method is required if TXMLOject instances of the SAX object modelo in question require serialization as a character stream, e.g. for the writeTo method of TXMLObject.

Parameters:
writer - a Writer instance to be used to write the document content as a character output stream.


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