|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.softwareag.tamino.db.api.objectModel.sax.TSAXElementDefaultHandler
public abstract class TSAXElementDefaultHandler
TSAXElementDefaultHandler is a SAX DefaultHandler class. You must provide a class extending this class when using a SAX object model and intend to use the SAX object model to process XML documents resulting from a query.
The TSAXElementDefaultHandler instance specified for a SAX object model receives events for an XML object obtained from Tamino as the reuslt of a query. The element handler receives element events starting with the first member of the query result set. It should create an instance of the class implementing the TSAXElement interface associated with the same SAX object model for each of these members. The following code example shows the usage of a SAX object model and an element handler.
// instantiate a SAX object model with an element handler TSAXObjectModel mySAXObjectModel = new TSAXObjectModel( "MySAXModel" , null , MySAXElement.class , null , mySAXElementDefaultHandler ); TXMLObjectAccessor accessor = connection.newXMLObjectAccessor( TAccessLocation.newInstance( "some collection" ), mySAXObjectModel ); TReponse response = accessor.query( new TQuery( "some query expression" ) ); // get the first member of the query result set TXMLObject xmlObject = response.getFirstXMLObject(); // get the first SAX element instance. // the SAX element default handler received the SAX events and build this. MySaxElement mySaxElement = (MySaxElement)xmlObject.getElement(); mySaxElement.????;
Field Summary | |
---|---|
static java.lang.String |
SPECIFIER
An internal identification for this interface. |
Constructor Summary | |
---|---|
TSAXElementDefaultHandler()
|
Method Summary | |
---|---|
abstract java.util.Iterator<TStreamElement> |
getElementIterator()
Returns an iterator to iterate over the members of the query result set. |
abstract TSAXElement |
getFirstElement()
Returns the first TSAXElement instance representing the first member of the query result set. |
void |
reset()
Clears the content that might currently be available thru getFirstElement and getElementIterator. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SPECIFIER
Constructor Detail |
---|
public TSAXElementDefaultHandler()
Method Detail |
---|
public abstract TSAXElement getFirstElement()
public abstract java.util.Iterator<TStreamElement> getElementIterator()
public void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |