public class DalResultStreamer extends TableContentHandler implements TableHandler
Constructor and Description |
---|
DalResultStreamer(TableSink sink)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endTable()
Called when there are no more rows to be transmitted.
|
boolean |
getOverflow()
Indicates whether the DAL result was marked as overflowing
(with QUERY_STATUS INFO).
|
void |
rowData(Object[] row)
Called when a row has been read.
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startTable(StarTable meta)
Called when a table is about to be transmitted.
|
static boolean |
streamResultTable(InputSource saxsrc,
TableSink sink)
Streams a DAL result table from a SAX source to a table sink.
|
endDocument, endPrefixMapping, getLocator, getReadHrefTables, getTableHandler, ignorableWhitespace, processingInstruction, setDocumentLocator, setReadHrefTables, setTableHandler, skippedEntity, startDocument, startPrefixMapping
public DalResultStreamer(TableSink sink)
sink
- table destinationpublic boolean getOverflow()
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class TableContentHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class TableContentHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class TableContentHandler
SAXException
public void startTable(StarTable meta) throws SAXException
TableHandler
startElement
and endElement
calls.
The metadata
argument signals column and table metadata
argument about the table whose rows are about to be transmitted.
If the number of rows that will be transmitted via subsequent
calls to rowData
is known, this value should be made
available as the row count of metadata
(StarTable.getRowCount()
); if it is not known, the row count
should be -1. However, this object should not attempt to read
any of meta
's cell data.
The data to be transmitted in subsequent calls of acceptRow
must match the metadata transmitted in this call in the same way
that rows of a StarTable must match its own metadata (number and
content clases of columns etc).
startTable
in interface TableHandler
meta
- metadata objectSAXException
public void rowData(Object[] row) throws SAXException
TableHandler
startTable
and endTable
calls.rowData
in interface TableHandler
row
- array of data objects representing a row in the
current tableSAXException
public void endTable() throws SAXException
TableHandler
endTable
in interface TableHandler
SAXException
public static boolean streamResultTable(InputSource saxsrc, TableSink sink) throws IOException, SAXException
saxsrc
- SAX event sourcesink
- table destinationIOException
SAXException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.