|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.votable.VOTableWriter
Implementation of the StarTableWriter interface for VOTables. The dataFormat and inline attributes can be modified to affect how the bulk cell data are output - this may be in TABLEDATA, FITS or BINARY format, and in the latter two cases may be either inline as base64 encoded CDATA or to a separate stream.
Field Summary | |
static String |
DEFAULT_DOCTYPE_DECLARATION
Default document type declaration in written documents. |
static String |
DEFAULT_VOTABLE_VERSION
Default VOTABLE version number. |
static String |
DEFAULT_XML_DECLARATION
Default XML declaration in written documents. |
Constructor Summary | |
VOTableWriter()
Constructs a default VOTableWriter. |
|
VOTableWriter(DataFormat dataFormat,
boolean inline)
Constructs a VOTableWriter with specified output characteristics. |
Method Summary | |
DataFormat |
getDataFormat()
Returns the format in which this writer will output the bulk table data. |
String |
getDoctypeDeclaration()
Returns the document type declaration which is used by this writer at the head of any document written. |
String |
getFormatName()
Gives the name of the format which is written by this writer. |
boolean |
getInline()
Indicates whether STREAM elements will be written inline or to an external file in the case of FITS and BINARY encoding. |
static StarTableWriter[] |
getStarTableWriters()
Returns a list of votable writers with variant values of attributes. |
String |
getXMLDeclaration()
Returns the XML declaration which is used by this writer at the head of any document written. |
boolean |
looksLikeFile(String filename)
Returns true for filenames with the extension ".xml", ".vot" or ".votable"; |
void |
setDataFormat(DataFormat format)
Sets the format in which the table data will be output. |
void |
setDoctypeDeclaration(String doctypeDecl)
Sets the document type declaration which will be used by this writer at the head of any document written. |
void |
setInline(boolean inline)
Sets whether STREAM elements should be written inline or to an external file in the case of FITS and BINARY encoding. |
void |
setXMLDeclaration(String xmlDecl)
Sets the XML declaration which will be used by this writer at the head of any document written. |
void |
writeStarTable(StarTable startab,
OutputStream out)
Writes a StarTable to a given stream; must be inline. |
void |
writeStarTable(StarTable startab,
OutputStream out,
File file)
Writes a StarTable to a given stream. |
void |
writeStarTable(StarTable startab,
String location,
StarTableOutput sto)
Writes a StarTable to a given location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DEFAULT_XML_DECLARATION
public static final String DEFAULT_DOCTYPE_DECLARATION
public static final String DEFAULT_VOTABLE_VERSION
Constructor Detail |
public VOTableWriter()
public VOTableWriter(DataFormat dataFormat, boolean inline)
dataFormat
- the format in which tables will be writteninline
- whether output of streamed formats should be
inline and base64-encoded or notMethod Detail |
public void writeStarTable(StarTable startab, String location, StarTableOutput sto) throws IOException
Currently, an entire XML VOTable document is written, and the TABLEDATA format (all table cells written inline as separate XML elements) is used.
writeStarTable
in interface StarTableWriter
startab
- the table to writelocation
- the filename to which to write the tablesto
- object used for location resolution
IOException
- if there is some I/O errorpublic void writeStarTable(StarTable startab, OutputStream out) throws IOException
writeStarTable(startab,out,null)
writeStarTable
in interface StarTableWriter
startab
- the table to writeout
- the stream down which to write the table
IOException
- if there is some I/O errorpublic void writeStarTable(StarTable startab, OutputStream out, File file) throws IOException
startab
- the table to writeout
- the stream down which to write the tablefile
- the filename to which out refers; this is used
if necessary to come up with a suitable filename for
related files which need to be written. May be null.
IOException
public boolean looksLikeFile(String filename)
looksLikeFile
in interface StarTableWriter
filename
- name of the file
public String getFormatName()
StarTableWriter
getFormatName
in interface StarTableWriter
public void setDataFormat(DataFormat format)
format
- bulk data formatpublic DataFormat getDataFormat()
public void setInline(boolean inline)
inline
- true iff streamed data will be encoded
inline in the STREAM elementpublic boolean getInline()
public void setXMLDeclaration(String xmlDecl)
DEFAULT_XML_DECLARATION
.
xmlDecl
- new XML declarationpublic String getXMLDeclaration()
public void setDoctypeDeclaration(String doctypeDecl)
DEFAULT_DOCTYPE_DECLARATION
.
doctypeDecl
- new declarationpublic String getDoctypeDeclaration()
public static StarTableWriter[] getStarTableWriters()
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |