Package uk.ac.starlink.votable
Class TableContentHandler
java.lang.Object
uk.ac.starlink.votable.TableContentHandler
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidvoidendElement(String namespaceURI, String localName, String qName) voidendPrefixMapping(String prefix) Returns the document locator.booleanIndicates whether href-referenced tables should be streamed to the table handler.Returns the TableHandler object for this parser.voidignorableWhitespace(char[] ch, int start, int length) voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) voidsetReadHrefTables(boolean readHrefs) Sets whether href-referenced tables should be streamed to the table handler.voidsetTableHandler(TableHandler handler) Sets the TableHandler object for this parser.voidskippedEntity(String name) voidvoidstartElement(String namespaceURI, String localName, String qName, Attributes atts) voidstartPrefixMapping(String prefix, String uri) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.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
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
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
Returns the document locator.- Returns:
- locator
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-