Package uk.ac.starlink.topcat.vizier

# Class CatalogSaxHandler

java.lang.Object
org.xml.sax.helpers.DefaultHandler
uk.ac.starlink.topcat.vizier.CatalogSaxHandler

All Implemented Interfaces:
  `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`

public abstract class CatalogSaxHandler extends DefaultHandler
SAX content handler which can make sense of a VizieR query for catalogues. The stream expected is of the kind you get if you make a query like `.../viz-bin/?votable&-meta` to vizier (as at Nov 2009). May 2010: `.../viz-bin?votable&-meta=t` gives information about sub-tables too.

Since:
  4 nov 2009
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`CatalogSaxHandler(boolean includeObsolete)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`characters(char[] ch, int start, int length)`
`void`
`endElement(String uri, String localName, String qName)`
`protected abstract void`
`gotCatalog(VizierCatalog cat)`
Called when a catalogue has been obtained from the SAX stream.
`void`
`startElement(String uri, String localName, String qName, Attributes atts)`

### Methods inherited from class org.xml.sax.helpers.DefaultHandler

`endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

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

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

### Methods inherited from interface org.xml.sax.ContentHandler

`declaration`

## Constructor Details

### CatalogSaxHandler

public CatalogSaxHandler(boolean includeObsolete)
Constructor.

Parameters:
  `includeObsolete` - true to include all results, false to omit older versions of the same catalog

## Method Details

### gotCatalog

protected abstract void gotCatalog(VizierCatalog cat) throws SAXException
Called when a catalogue has been obtained from the SAX stream.

Parameters:
  `cat` - newly acquired catlogue
Throws:
  `SAXException`

### characters

public void characters(char[] ch, int start, int length)

Specified by:
  `characters` in interface `ContentHandler`
Overrides:
  `characters` in class `DefaultHandler`

### startElement

public void startElement(String uri, String localName, String qName, Attributes atts)

Specified by:
  `startElement` in interface `ContentHandler`
Overrides:
  `startElement` in class `DefaultHandler`

### endElement

public void endElement(String uri, String localName, String qName) throws SAXException

Specified by:
  `endElement` in interface `ContentHandler`
Overrides:
  `endElement` in class `DefaultHandler`
Throws:
  `SAXException`