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

All Known Implementing Classes:
TStreamElement

public interface TSAXElement

TSAXElement interface represents an XML element. 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 Tamino query results. An implementation is also required if there exists a meaningful implementation of the getRootElement method of the class implementing the TSAXDocument interface.

The class implementing the TSAXElement interface works in close relationship with a TSAXElementDefaultHandler implementation. This class handles the SAX events and normally produces a set of instances of the associated TSAXElement class. The class implementing the TSAXElement interface also determines the type of objects returned by TXMLObject.getElement, TSAXElementDefaultHandler.getFirstElement and TSAXElementDefaultHandler.getElementIterator.next.

The operations defined by this interface are required for a fully functional TXMLObject. For example, omitting the implementation of setDocname implies that no docname can be set on the TXMLObject. The set/get methods of a TXMLObject are delagated to the corresponding methods of the class implementing this interface.

Version:
$Revision: 1.8 $
Author:
Marcus Schreyer

Method Summary
 java.lang.String getDocname()
          Gets the ino:docname of the underlying SAX element, if it exists.
 java.lang.String getDoctype()
          Gets the doctype of the underlying SAX element if it exists.
 java.lang.String getId()
          Gets the ino:id if of the underlying SAX element, if it exists.
 void setDocname(java.lang.String docname)
          Sets the ino:docname on the underlying element.
 void setId(java.lang.String id)
          Sets the ino:id on the underlying element.
 void writeTo(java.io.Writer writer)
          Serializes the content of the underlying SAX element as a character stream.
 

Method Detail

setDocname

void setDocname(java.lang.String docname)
Sets the ino:docname on the underlying element. An implementation of this method is required for a fully functional TXMLObject. This method corresponds to the setDocname method of TXMLObject.

Parameters:
docname - the ino:docname attribute of the XML document.

setId

void setId(java.lang.String id)
Sets the ino:id on the underlying element. An implementation of this method is required for a fully functional TXMLObject. This method corresponds to the setId method of TXMLObject.

Parameters:
id - the ino:id attribute of the XML document.

getDoctype

java.lang.String getDoctype()
Gets the doctype of the underlying SAX element if it exists. A doctype is required for Tamino update and insert operations specifying a docname. This method returns the doctype representing the default doctype used for these type of operations. You can use the setDoctype method of TXMLObject to set the doctype explicitly.

Returns:
the doctype of the sax element if it exist, otherwise an empty string.

getDocname

java.lang.String getDocname()
Gets the ino:docname of the underlying SAX element, if it exists.

Returns:
the docname of the sax element if it exist, otherwise an empty string.

getId

java.lang.String getId()
Gets the ino:id if of the underlying SAX element, if it exists.

Returns:
the ino:id of the sax element, otherwise an empty string.

writeTo

void writeTo(java.io.Writer writer)
Serializes the content of the underlying SAX element as a character stream. An implementation of this method is required for a fully functional TXMLObject. Each TXMLObject is streamable through the TStreamable interface. The TStreamable interface allows a TXMLObject instance to be serialized for normal Java Serializable purposes as well as allow it to be written to Tamino. An implementation of the writeTo method which allows writing to Tamino must serialize the content of the underlying SAX element as well-formed XML.

Parameters:
writer - the character stream to which the content of the SAX element is written.


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