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 TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
void
endElement
(String namespaceURI, String localName, String qName) void
endPrefixMapping
(String prefix) Returns the document locator.boolean
Indicates whether href-referenced tables should be streamed to the table handler.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
void
startElement
(String namespaceURI, String localName, String qName, Attributes atts) void
startPrefixMapping
(String prefix, String uri) 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
-
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:
setDocumentLocator
in interfaceContentHandler
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-