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 TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidvoidendElement(String uri, String localName, String qName) voidendPrefixMapping(String prefix) Returns the DOM document built by this parser, following a parse.voidignorableWhitespace(char[] ch, int start, int length) voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) voidskippedEntity(String name) voidvoidstartElement(String uri, 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
-
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:
setDocumentLocatorin interfaceContentHandler
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, 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
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-