public abstract class TSAXElementDefaultHandler
extends org.xml.sax.helpers.DefaultHandler
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.????;
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SPECIFIER
An internal identification for this interface.
|
Constructor and Description |
---|
TSAXElementDefaultHandler() |
Modifier and Type | Method and Description |
---|---|
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.
|
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
public static final java.lang.String SPECIFIER
public abstract TSAXElement getFirstElement()
public abstract java.util.Iterator<TStreamElement> getElementIterator()
public void reset()
Copyright (c) 2017 Software AG. All Rights Reserved.