Package uk.ac.starlink.votable
Class VOTableDOMBuilder
java.lang.Object
uk.ac.starlink.votable.VOTableDOMBuilder
- All Implemented Interfaces:
ContentHandler
Custom DOM builder for parsing VOTable documents or fragments.
For the most part it builds a DOM, but within data-heavy elements
(those which represent table data) it intercepts SAX events
directly to construct the table data
which it stores in the corresponding TableElement node,
rather than installing bulk data
as CDATA or Element nodes within the resulting DOM.
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionVOTableDOMBuilder
(uk.ac.starlink.table.StoragePolicy storagePolicy, boolean strict) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
void
endElement
(String uri, String localName, String qName) void
endPrefixMapping
(String prefix) Returns the DOM document built by this parser, following a parse.void
ignorableWhitespace
(char[] ch, int start, int length) void
processingInstruction
(String target, String data) void
setDocumentLocator
(Locator locator) void
skippedEntity
(String name) void
void
startElement
(String uri, 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
-
VOTableDOMBuilder
public VOTableDOMBuilder(uk.ac.starlink.table.StoragePolicy storagePolicy, boolean strict) Constructor.- Parameters:
storagePolicy
- policy for bulk data storagestrict
- true iff you want strict enforcement of VOTable standard
-
-
Method Details
-
getDocument
Returns the DOM document built by this parser, following a parse. Each TableElement has a TabularData object attached from which the actual table data can be retrieved.- Returns:
- VOTable DOM
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, 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
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-