Class DalResultStreamer

java.lang.Object
uk.ac.starlink.votable.TableContentHandler
uk.ac.starlink.vo.DalResultStreamer
All Implemented Interfaces:
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 Details

    • DalResultStreamer

      public DalResultStreamer(uk.ac.starlink.table.TableSink sink)
      Constructor.
      Parameters:
      sink - table destination
  • Method Details

    • 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(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class uk.ac.starlink.votable.TableContentHandler
      Throws:
      SAXException
    • endElement

      public void endElement(String namespaceURI, String localName, String qName) throws SAXException
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class uk.ac.starlink.votable.TableContentHandler
      Throws:
      SAXException
    • characters

      public void characters(char[] ch, int start, int length) throws SAXException
      Specified by:
      characters in interface ContentHandler
      Overrides:
      characters in class uk.ac.starlink.votable.TableContentHandler
      Throws:
      SAXException
    • startTable

      public void startTable(uk.ac.starlink.table.StarTable meta) throws SAXException
      Specified by:
      startTable in interface uk.ac.starlink.votable.TableHandler
      Throws:
      SAXException
    • rowData

      public void rowData(Object[] row) throws SAXException
      Specified by:
      rowData in interface uk.ac.starlink.votable.TableHandler
      Throws:
      SAXException
    • endTable

      public void endTable() throws SAXException
      Specified by:
      endTable in interface uk.ac.starlink.votable.TableHandler
      Throws:
      SAXException
    • streamResultTable

      public static boolean streamResultTable(InputSource saxsrc, uk.ac.starlink.table.TableSink sink) throws IOException, 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:
      IOException
      SAXException