|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.votable.VOSerializer
Class which knows how to serialize a table's fields and data to
VOTable elements. For writing a full VOTable document
which contains a single table the VOTableWriter
class may be more convenient, but
this class can be used in a more flexible way, by writing only
the elements which are required.
Obtain an instance of this class using the makeSerializer(uk.ac.starlink.votable.DataFormat, uk.ac.starlink.table.StarTable)
method.
Method Summary | |
static char |
ensureLegalXml(char c)
Returns a legal XML character corresponding to an input character. |
static String |
formatAttribute(String name,
String value)
Turns a name,value pair into an attribute assignment suitable for putting in an XML start tag. |
static String |
formatText(String text)
Performs necessary special character escaping for text which will be written as XML CDATA. |
DataFormat |
getFormat()
Returns the data format which this object can serialize to. |
StarTable |
getTable()
Returns the table object which this object can serialize. |
static VOSerializer |
makeFitsSerializer(StarTable table,
FitsTableSerializer fitser)
Constructs a FITS-type VOSerializer. |
static VOSerializer |
makeSerializer(DataFormat dataFormat,
StarTable table)
Factory method which returns a serializer capable of serializing a given table to a given data format. |
void |
writeDescription(BufferedWriter writer)
Writes any DESCRIPTION element associated with this serializer's table. |
abstract void |
writeFields(BufferedWriter writer)
Writes the FIELD headers corresponding to this table on a given writer. |
abstract void |
writeHrefDataElement(BufferedWriter xmlwriter,
String href,
DataOutput streamout)
Writes this serializer's table data to a <DATA> element containing a <STREAM> element which references an external data source (optional method). |
void |
writeHrefTableElement(BufferedWriter xmlwriter,
String href,
DataOutput streamout)
|
abstract void |
writeInlineDataElement(BufferedWriter writer)
Writes this serializer's table data as a self-contained <DATA> element. |
void |
writeInlineTableElement(BufferedWriter writer)
Writes this serializer's table as a complete TABLE element. |
void |
writeParams(BufferedWriter writer)
Writes any PARAM and INFO elements associated with this serializer's table. |
void |
writePostDataXML(BufferedWriter writer)
Outputs any content of the TABLE element following the DATA element and the TABLE end tag. |
void |
writePreDataXML(BufferedWriter writer)
Outputs the TABLE element start tag and all of its content before the DATA element. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public DataFormat getFormat()
public StarTable getTable()
public abstract void writeFields(BufferedWriter writer) throws IOException
writer
- destination stream
IOException
public abstract void writeInlineDataElement(BufferedWriter writer) throws IOException
writer
- destination stream
IOException
public abstract void writeHrefDataElement(BufferedWriter xmlwriter, String href, DataOutput streamout) throws IOException
xmlwriter
- destination stream for the XML outputhref
- URL for the external stream (output as the href
attribute of the written <STREAM> element)streamout
- destination stream for the binary table data
IOException
public void writeInlineTableElement(BufferedWriter writer) throws IOException
writer
- destination stream
IOException
public void writeHrefTableElement(BufferedWriter xmlwriter, String href, DataOutput streamout) throws IOException
IOException
public void writeParams(BufferedWriter writer) throws IOException
writer
- destination stream
IOException
public void writeDescription(BufferedWriter writer) throws IOException
writer
- destination stream
IOException
public void writePreDataXML(BufferedWriter writer) throws IOException
writer
- output stream
IOException
public void writePostDataXML(BufferedWriter writer) throws IOException
writer
- output stream
IOException
public static String formatAttribute(String name, String value)
name
- the attribute namevalue
- the attribute value
public static String formatText(String text)
text
- the input text
public static char ensureLegalXml(char c)
c
- input character
c
if possiblepublic static VOSerializer makeSerializer(DataFormat dataFormat, StarTable table) throws IOException
dataFormat
- one of the supported VOTable serialization formatstable
- the table to be serialized
IOException
public static VOSerializer makeFitsSerializer(StarTable table, FitsTableSerializer fitser) throws IOException
makeSerializer
which will have to construct another,
possibly an expensive step.
table
- table for serializationfitser
- fits serializer
IOException
|
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 |