Package uk.ac.starlink.vo

## Class DalResultStreamer

- java.lang.Object
- - uk.ac.starlink.votable.TableContentHandler
  - - uk.ac.starlink.vo.DalResultStreamer

- All Implemented Interfaces:
    `org.xml.sax.ContentHandler`, `uk.ac.starlink.votable.TableHandler`

      public class DalResultStreamer
      extends uk.ac.starlink.votable.TableContentHandler
      implements uk.ac.starlink.votable.TableHandler

  SAX table handler for processing VOTable documents returned from DAL services. The result table has to be in a type="results" RESOURCE following DAL rules. The QUERY_STATUS INFO elements are understood, and a table marked with error status causes an exception to be thrown by the SAX parser. A successful parse streams the table data to a supplied sink.
  Since:
    10 Apr 2013
  Author:
    Mark Taylor

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DalResultStreamer​(uk.ac.starlink.table.TableSink sink)` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `characters​(char[] ch, int start, int length)` |
    `void` | `endElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)` |
    `void` | `endTable()` |
    `boolean` | `getOverflow()` | Indicates whether the DAL result was marked as overflowing (with QUERY_STATUS INFO).
    `void` | `rowData​(java.lang.Object[] row)` |
    `void` | `startElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)` |
    `void` | `startTable​(uk.ac.starlink.table.StarTable meta)` |
    `static boolean` | `streamResultTable​(org.xml.sax.InputSource saxsrc, uk.ac.starlink.table.TableSink sink)` | Streams a DAL result table from a SAX source to a table sink.

    - ### Methods inherited from class uk.ac.starlink.votable.TableContentHandler

      `endDocument, endPrefixMapping, getLocator, getReadHrefTables, getTableHandler, ignorableWhitespace, processingInstruction, setDocumentLocator, setReadHrefTables, setTableHandler, skippedEntity, startDocument, startPrefixMapping`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DalResultStreamer

          public DalResultStreamer​(uk.ac.starlink.table.TableSink sink)

      Constructor.
      Parameters:
        `sink` - table destination

  - ### Method Detail

    - #### getOverflow

          public boolean getOverflow()

      Indicates whether the DAL result was marked as overflowing (with QUERY_STATUS INFO). Will be set or not set after a successful parse.
      Returns:
        true iff an overflow marker has been encountered

    - #### startElement

          public void startElement​(java.lang.String namespaceURI,
                                   java.lang.String localName,
                                   java.lang.String qName,
                                   org.xml.sax.Attributes atts)
                            throws org.xml.sax.SAXException

      Specified by:
        `startElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startElement` in class `uk.ac.starlink.votable.TableContentHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### endElement

          public void endElement​(java.lang.String namespaceURI,
                                 java.lang.String localName,
                                 java.lang.String qName)
                          throws org.xml.sax.SAXException

      Specified by:
        `endElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endElement` in class `uk.ac.starlink.votable.TableContentHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### characters

          public void characters​(char[] ch,
                                 int start,
                                 int length)
                          throws org.xml.sax.SAXException

      Specified by:
        `characters` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `characters` in class `uk.ac.starlink.votable.TableContentHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### startTable

          public void startTable​(uk.ac.starlink.table.StarTable meta)
                          throws org.xml.sax.SAXException

      Specified by:
        `startTable` in interface `uk.ac.starlink.votable.TableHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### rowData

          public void rowData​(java.lang.Object[] row)
                       throws org.xml.sax.SAXException

      Specified by:
        `rowData` in interface `uk.ac.starlink.votable.TableHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### endTable

          public void endTable()
                        throws org.xml.sax.SAXException

      Specified by:
        `endTable` in interface `uk.ac.starlink.votable.TableHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### streamResultTable

          public static boolean streamResultTable​(org.xml.sax.InputSource saxsrc,
                                                  uk.ac.starlink.table.TableSink sink)
                                           throws java.io.IOException,
                                                  org.xml.sax.SAXException

      Streams a DAL result table from a SAX source to a table sink.
      Parameters:
        `saxsrc` - SAX event source
        `sink` - table destination
      Returns:
        true iff the result was marked as overflowed
      Throws:
        `java.io.IOException`
        `org.xml.sax.SAXException`