# Class TableContentHandler

java.lang.Object
uk.ac.starlink.votable.TableContentHandler

All Implemented Interfaces:
  `ContentHandler`

public class TableContentHandler extends Object implements ContentHandler
Content handler which translates SAX events into table events. It holds a `TableHandler` object which, if non-null, is messaged for every suitable DATA element in the input stream. Inline tables (TABLEDATA ones and FITS/BINARY/BINARY2 ones in which STREAM element contains the byte data as text children) are always messaged to the handler. Externally-referenced ones (FITS/BINARY/BINARY2 ones in which the data is located from an `href` attribute on the STREAM element) may either be ignored or streamed to the table handler according to the setting of the `setReadHrefTables` member.

Since:
  15 Apr 2005
Author:
  Mark Taylor (Starlink)

## Constructor Summary

Constructors
Constructor
Description
`TableContentHandler(boolean strict)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`characters(char[] ch, int start, int length)`
`void`
`endDocument()`
`void`
`endElement(String namespaceURI, String localName, String qName)`
`void`
`endPrefixMapping(String prefix)`
`Locator`
`getLocator()`
Returns the document locator.
`boolean`
`getReadHrefTables()`
Indicates whether href-referenced tables should be streamed to the table handler.
`TableHandler`
`getTableHandler()`
Returns the TableHandler object for this parser.
`void`
`ignorableWhitespace(char[] ch, int start, int length)`
`void`
`processingInstruction(String target, String data)`
`void`
`setDocumentLocator(Locator locator)`
`void`
`setReadHrefTables(boolean readHrefs)`
Sets whether href-referenced tables should be streamed to the table handler.
`void`
`setTableHandler(TableHandler handler)`
Sets the TableHandler object for this parser.
`void`
`skippedEntity(String name)`
`void`
`startDocument()`
`void`
`startElement(String namespaceURI, String localName, String qName, Attributes atts)`
`void`
`startPrefixMapping(String prefix, String uri)`

### Methods inherited from class Object

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

### Methods inherited from interface ContentHandler

`declaration`

## Constructor Details

### TableContentHandler

public TableContentHandler(boolean strict)
Constructor.

Parameters:
  `strict` - whether to effect a strict reading of the VOTable standard

## Method Details

### setTableHandler

public void setTableHandler(TableHandler handler)
Sets the TableHandler object for this parser. If set to a non-null value, the handler will be messaged with the table metadata and data for each table (each DATA element) encountered in parsing the VOTable document.

Parameters:
  `handler` - table handler

### getTableHandler

public TableHandler getTableHandler()
Returns the TableHandler object for this parser.

Returns:
  table handler

### setReadHrefTables

public void setReadHrefTables(boolean readHrefs)
Sets whether href-referenced tables should be streamed to the table handler.

Parameters:
  `readHrefs` - if true, externally-referenced tables will be messaged to the handler, if false they will be ignored

### getReadHrefTables

public boolean getReadHrefTables()
Indicates whether href-referenced tables should be streamed to the table handler.

Returns:
  true if externally-referenced tables will be messaged to the handler, false if they will be ignored

### getLocator

public Locator getLocator()
Returns the document locator.

Returns:
  locator

### setDocumentLocator

public void setDocumentLocator(Locator locator)

Specified by:
  `setDocumentLocator` in interface `ContentHandler`

### startDocument

public void startDocument() throws SAXException

Specified by:
  `startDocument` in interface `ContentHandler`
Throws:
  `SAXException`

### endDocument

public void endDocument() throws SAXException

Specified by:
  `endDocument` in interface `ContentHandler`
Throws:
  `SAXException`

### startElement

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException

Specified by:
  `startElement` in interface `ContentHandler`
Throws:
  `SAXException`

### endElement

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

Specified by:
  `endElement` in interface `ContentHandler`
Throws:
  `SAXException`

### characters

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

Specified by:
  `characters` in interface `ContentHandler`
Throws:
  `SAXException`

### ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException

Specified by:
  `ignorableWhitespace` in interface `ContentHandler`
Throws:
  `SAXException`

### startPrefixMapping

public void startPrefixMapping(String prefix, String uri) throws SAXException

Specified by:
  `startPrefixMapping` in interface `ContentHandler`
Throws:
  `SAXException`

### endPrefixMapping

public void endPrefixMapping(String prefix) throws SAXException

Specified by:
  `endPrefixMapping` in interface `ContentHandler`
Throws:
  `SAXException`

### skippedEntity

public void skippedEntity(String name) throws SAXException

Specified by:
  `skippedEntity` in interface `ContentHandler`
Throws:
  `SAXException`

### processingInstruction

public void processingInstruction(String target, String data) throws SAXException

Specified by:
  `processingInstruction` in interface `ContentHandler`
Throws:
  `SAXException`