public class VotCopyHandler extends Object implements ContentHandler, LexicalHandler, TableHandler
One exception to the rule is that, for implementation-specific
reasons, FIELD elements with datatype="bit" are
changed to have datatype="boolean" instead.
| Constructor and Description |
|---|
VotCopyHandler(boolean strict,
DataFormat format,
VOTableVersion version,
boolean inline,
boolean squashMagic,
String base,
boolean cache,
StoragePolicy policy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
comment(char[] ch,
int start,
int length) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
endTable()
Called when there are no more rows to be transmitted.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
processingInstruction(String target,
String data) |
void |
rowData(Object[] row)
Called when a row has been read.
|
void |
setDocumentLocator(Locator locator) |
void |
setOutput(Writer out)
Sets the output stream for output.
|
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
startTable(StarTable meta)
Called when a table is about to be transmitted.
|
void |
writeDataElement(StarTable table)
Outputs a DATA element representing a table to the destination stream
according to the current settings.
|
public VotCopyHandler(boolean strict,
DataFormat format,
VOTableVersion version,
boolean inline,
boolean squashMagic,
String base,
boolean cache,
StoragePolicy policy)
cache parameter.
In streamed mode, each row encountered in the input SAX stream
is copied to the output stream as soon as it is encountered.
In cached mode, the whole table is assembled first, and then
written out at the end of the input. Streamed mode is more efficient,
but may not be possible under some circumstances, e.g. for FITS
output when the number of rows is not known in advance.
If a streamed copy is attempted when it's not possible,
it will fail with a
UnrepeatableSequenceException
(wrapped in a SAXException).strict - whether to effect strict interpretation of the
VOTable standardformat - encoding type for output DATA elements; may be null
for DATA-less outputversion - VOTable standard version for output; may be null for
unknown or indeterminate, in which case input version
will be copied as far as possibleinline - true for tables written inline, false for tables written
to an href-referenced streamsquashMagic - if true, any VALUES/null attributes are not
passed throughbase - base table location; used to construct URIs for
out-of-line table streams (only used if inline=false)cache - whether tables will be cached prior to writingpolicy - storage policy for cached tablespublic void setOutput(Writer out)
out - output writerpublic void startTable(StarTable meta) throws SAXException
TableHandlerstartElement and endElement calls.
The metadata argument signals column and table metadata
argument about the table whose rows are about to be transmitted.
If the number of rows that will be transmitted via subsequent
calls to rowData is known, this value should be made
available as the row count of metadata
(StarTable.getRowCount()); if it is not known, the row count
should be -1. However, this object should not attempt to read
any of meta's cell data.
The data to be transmitted in subsequent calls of acceptRow
must match the metadata transmitted in this call in the same way
that rows of a StarTable must match its own metadata (number and
content clases of columns etc).
startTable in interface TableHandlermeta - metadata objectSAXExceptionpublic void rowData(Object[] row) throws SAXException
TableHandlerstartTable and endTable calls.rowData in interface TableHandlerrow - array of data objects representing a row in the
current tableSAXExceptionpublic void endTable()
throws SAXException
TableHandlerendTable in interface TableHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic void writeDataElement(StarTable table) throws IOException
table - table to writeIOExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.