Package cds.savot.writer
Class SavotWriter
- java.lang.Object
-
- cds.savot.writer.SavotWriter
-
public final class SavotWriter extends java.lang.Object
VOTable document generation from memory
- Author:
- Andre Schaaff 6 June 2005 : the user can now write a VOTable document flow step by step, the previous method is available too (writing of a whole document) (kickoff 31 May 02)
-
-
Constructor Summary
Constructors Constructor Description SavotWriter()
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableAttributeEntities(boolean entities)
Enable or disable Attribute entities mappingvoid
enableElementEntities(boolean entities)
Enable or disable Element entities mappingvoid
enableEntities(boolean entities)
Enable or disable Attribute and Element entities mappingjava.lang.String
encodeAttribute(java.lang.String src)
Encode special characters to entitiesjava.lang.String
encodeElement(java.lang.String src)
Encode special characters to entitiesvoid
generateDocument(SavotVOTable votable)
Generates a VOTable XML document corresponding to the internal model The result is sent to the standard outputvoid
generateDocument(SavotVOTable votable, java.io.OutputStream stream)
Generates a VOTable XML document corresponding to the internal modelvoid
generateDocument(SavotVOTable votable, java.lang.String file)
Generates a VOTable XML document corresponding to the internal modelvoid
generateDocument(SavotVOTable votable, java.lang.String file, java.io.OutputStream stream)
Generates a VOTable XML document corresponding to the internal modelvoid
initStream(java.io.OutputStream stream)
Init the Stream for the outputvoid
initStream(java.io.Writer writer)
Init the Stream for the output using the given Writervoid
initStream(java.lang.String file)
Init the Stream for the outputvoid
setStyleSheet(java.lang.String href)
Set a stylesheet Also possible with setTop1void
setTop1(java.lang.String top1)
Change the default XML document head Default valuevoid
writeBinary(SavotBinary binary)
Write a BINARY elementvoid
writeComment(java.lang.String comment)
Write a commentvoid
writeCoosys(CoosysSet coosysSet)
Write a COOSYS setvoid
writeDataBegin()
Write a DATA beginvoid
writeDataEnd()
Write a DATA endvoid
writeDescription(java.lang.String description)
Write a descriptionvoid
writeDocumentEnd()
Write a VOTable XML endvoid
writeDocumentHead(SavotVOTable votable)
Write a VOTable XML headvoid
writeField(FieldSet fieldSet)
Write a FIELD setvoid
writeFieldRef(FieldRefSet fieldRefSet)
Write a FIELD setvoid
writeFits(SavotFits fits)
Write a FITS elementvoid
writeGroup(GroupSet groupSet)
Write a GROUP setvoid
writeInfo(InfoSet infoSet)
Write an INFO setvoid
writeLink(LinkSet linkSet)
Write a LINK setvoid
writeMax(SavotMax max)
Write a MAX elementvoid
writeMin(SavotMin min)
Write a MIN elementvoid
writeOption(OptionSet optionSet)
Write an OPTION setvoid
writeParam(ParamSet params)
Write a PARAM setvoid
writeParamRef(ParamRefSet refparams)
Write a PARAMref setvoid
writeResource(ResourceSet resourceset)
Write a RESOURCE setvoid
writeResourceBegin(SavotResource resource)
Write a RESOURCE beginvoid
writeResourceEnd()
Write a RESOURCE endvoid
writeStream(SavotStream stream)
Write a STREAM elementvoid
writeTableBegin(SavotTable table)
Write a TABLE beginvoid
writeTableDataBegin()
Write a TABLEDATA beginvoid
writeTableDataEnd()
Write a TABLEDATA endvoid
writeTableEnd()
Write a TABLE endvoid
writeTR(SavotTR tr)
Write a TRvoid
writeValues(SavotValues values)
Write a VALUES element
-
-
-
Method Detail
-
setTop1
public void setTop1(java.lang.String top1)
Change the default XML document head Default value- Parameters:
top1
-- Since:
- VOTable 1.2
-
setStyleSheet
public void setStyleSheet(java.lang.String href)
Set a stylesheet Also possible with setTop1- Parameters:
href
-- Since:
- VOTable 1.2
-
enableAttributeEntities
public void enableAttributeEntities(boolean entities)
Enable or disable Attribute entities mapping- Parameters:
entities
- true if Attribute entities are taken into account
-
enableElementEntities
public void enableElementEntities(boolean entities)
Enable or disable Element entities mapping- Parameters:
entities
- true if Element entities are taken into account
-
enableEntities
public void enableEntities(boolean entities)
Enable or disable Attribute and Element entities mapping- Parameters:
entities
- true if all entities are taken into account
-
encodeAttribute
public java.lang.String encodeAttribute(java.lang.String src)
Encode special characters to entities- Parameters:
src
-- Returns:
- src
-
encodeElement
public java.lang.String encodeElement(java.lang.String src)
Encode special characters to entities- Parameters:
src
-- Returns:
- src
-
generateDocument
public void generateDocument(SavotVOTable votable) throws java.io.IOException
Generates a VOTable XML document corresponding to the internal model The result is sent to the standard output- Parameters:
votable
- object corresponding to the savot internal model- Throws:
java.io.IOException
-
generateDocument
public void generateDocument(SavotVOTable votable, java.io.OutputStream stream) throws java.io.IOException
Generates a VOTable XML document corresponding to the internal model- Parameters:
votable
- object corresponding to the savot internal modelstream
- the result is sent to this stream- Throws:
java.io.IOException
-
generateDocument
public void generateDocument(SavotVOTable votable, java.lang.String file) throws java.io.IOException
Generates a VOTable XML document corresponding to the internal model- Parameters:
votable
- object corresponding to the savot internal modelfile
- is sent to this file- Throws:
java.io.IOException
-
generateDocument
public void generateDocument(SavotVOTable votable, java.lang.String file, java.io.OutputStream stream) throws java.io.IOException
Generates a VOTable XML document corresponding to the internal model- Parameters:
votable
- SavotVOTablefile
- Stringstream
- OutputStream- Throws:
java.io.IOException
-
initStream
public void initStream(java.lang.String file) throws java.io.IOException
Init the Stream for the output- Parameters:
file
- String- Throws:
java.io.IOException
-
initStream
public void initStream(java.io.OutputStream stream) throws java.io.IOException
Init the Stream for the output- Parameters:
stream
- OutputStream- Throws:
java.io.IOException
-
initStream
public void initStream(java.io.Writer writer)
Init the Stream for the output using the given Writer- Parameters:
writer
- writer implementation to write into
-
writeComment
public void writeComment(java.lang.String comment) throws java.io.IOException
Write a comment- Parameters:
comment
- String- Throws:
java.io.IOException
-
writeDescription
public void writeDescription(java.lang.String description) throws java.io.IOException
Write a description- Parameters:
description
-- Throws:
java.io.IOException
-
writeDocumentHead
public void writeDocumentHead(SavotVOTable votable) throws java.io.IOException
Write a VOTable XML head- Parameters:
votable
-- Throws:
java.io.IOException
-
writeDocumentEnd
public void writeDocumentEnd() throws java.io.IOException
Write a VOTable XML end- Throws:
java.io.IOException
-
writeCoosys
public void writeCoosys(CoosysSet coosysSet) throws java.io.IOException
Write a COOSYS set- Parameters:
coosysSet
-- Throws:
java.io.IOException
-
writeParam
public void writeParam(ParamSet params) throws java.io.IOException
Write a PARAM set- Parameters:
params
-- Throws:
java.io.IOException
-
writeParamRef
public void writeParamRef(ParamRefSet refparams) throws java.io.IOException
Write a PARAMref set- Parameters:
refparams
-- Throws:
java.io.IOException
-
writeLink
public void writeLink(LinkSet linkSet) throws java.io.IOException
Write a LINK set- Parameters:
linkSet
-- Throws:
java.io.IOException
-
writeInfo
public void writeInfo(InfoSet infoSet) throws java.io.IOException
Write an INFO set- Parameters:
infoSet
-- Throws:
java.io.IOException
-
writeField
public void writeField(FieldSet fieldSet) throws java.io.IOException
Write a FIELD set- Parameters:
fieldSet
-- Throws:
java.io.IOException
-
writeFieldRef
public void writeFieldRef(FieldRefSet fieldRefSet) throws java.io.IOException
Write a FIELD set- Parameters:
fieldRefSet
-- Throws:
java.io.IOException
-
writeStream
public void writeStream(SavotStream stream) throws java.io.IOException
Write a STREAM element- Parameters:
stream
-- Throws:
java.io.IOException
-
writeBinary
public void writeBinary(SavotBinary binary) throws java.io.IOException
Write a BINARY element- Parameters:
binary
-- Throws:
java.io.IOException
-
writeValues
public void writeValues(SavotValues values) throws java.io.IOException
Write a VALUES element- Parameters:
values
-- Throws:
java.io.IOException
-
writeFits
public void writeFits(SavotFits fits) throws java.io.IOException
Write a FITS element- Parameters:
fits
-- Throws:
java.io.IOException
-
writeMin
public void writeMin(SavotMin min) throws java.io.IOException
Write a MIN element- Parameters:
min
-- Throws:
java.io.IOException
-
writeMax
public void writeMax(SavotMax max) throws java.io.IOException
Write a MAX element- Parameters:
max
-- Throws:
java.io.IOException
-
writeOption
public void writeOption(OptionSet optionSet) throws java.io.IOException
Write an OPTION set- Parameters:
optionSet
-- Throws:
java.io.IOException
-
writeGroup
public void writeGroup(GroupSet groupSet) throws java.io.IOException
Write a GROUP set- Parameters:
groupSet
-- Throws:
java.io.IOException
-
writeTableBegin
public void writeTableBegin(SavotTable table) throws java.io.IOException
Write a TABLE begin- Parameters:
table
- SavotTable- Throws:
java.io.IOException
-
writeTableEnd
public void writeTableEnd() throws java.io.IOException
Write a TABLE end- Throws:
java.io.IOException
-
writeResourceBegin
public void writeResourceBegin(SavotResource resource) throws java.io.IOException
Write a RESOURCE begin- Parameters:
resource
- SavotResource- Throws:
java.io.IOException
-
writeResourceEnd
public void writeResourceEnd() throws java.io.IOException
Write a RESOURCE end- Throws:
java.io.IOException
-
writeTableDataBegin
public void writeTableDataBegin() throws java.io.IOException
Write a TABLEDATA begin- Throws:
java.io.IOException
-
writeTableDataEnd
public void writeTableDataEnd() throws java.io.IOException
Write a TABLEDATA end- Throws:
java.io.IOException
-
writeDataBegin
public void writeDataBegin() throws java.io.IOException
Write a DATA begin- Throws:
java.io.IOException
-
writeDataEnd
public void writeDataEnd() throws java.io.IOException
Write a DATA end- Throws:
java.io.IOException
-
writeTR
public void writeTR(SavotTR tr) throws java.io.IOException
Write a TR- Parameters:
tr
-- Throws:
java.io.IOException
-
writeResource
public void writeResource(ResourceSet resourceset) throws java.io.IOException
Write a RESOURCE set- Parameters:
resourceset
- ResourceSet- Throws:
java.io.IOException
-
-