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
TableHandler
startElement
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 TableHandler
meta
- metadata objectSAXException
public void rowData(Object[] row) throws SAXException
TableHandler
startTable
and endTable
calls.rowData
in interface TableHandler
row
- array of data objects representing a row in the
current tableSAXException
public void endTable() throws SAXException
TableHandler
endTable
in interface TableHandler
SAXException
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
in interface LexicalHandler
SAXException
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
startEntity
in interface LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
endEntity
in interface LexicalHandler
SAXException
public void writeDataElement(StarTable table) throws IOException
table
- table to writeIOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.