Class SavotWriter

java.lang.Object
cds.savot.writer.SavotWriter

public final class SavotWriter extends 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 Details

    • SavotWriter

      public SavotWriter()
      Public constructor
  • Method Details

    • setTop1

      public void setTop1(String top1)
      Change the default XML document head Default value invalid input: '<'?xml version="1.0 encoding="UTF-8"?>
      Parameters:
      top1 -
      Since:
      VOTable 1.2
    • setStyleSheet

      public void setStyleSheet(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 String encodeAttribute(String src)
      Encode special characters to entities
      Parameters:
      src -
      Returns:
      src
    • encodeElement

      public String encodeElement(String src)
      Encode special characters to entities
      Parameters:
      src -
      Returns:
      src
    • generateDocument

      public void generateDocument(SavotVOTable votable) throws 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:
      IOException
    • generateDocument

      public void generateDocument(SavotVOTable votable, OutputStream stream) throws IOException
      Generates a VOTable XML document corresponding to the internal model
      Parameters:
      votable - object corresponding to the savot internal model
      stream - the result is sent to this stream
      Throws:
      IOException
    • generateDocument

      public void generateDocument(SavotVOTable votable, String file) throws IOException
      Generates a VOTable XML document corresponding to the internal model
      Parameters:
      votable - object corresponding to the savot internal model
      file - is sent to this file
      Throws:
      IOException
    • generateDocument

      public void generateDocument(SavotVOTable votable, String file, OutputStream stream) throws IOException
      Generates a VOTable XML document corresponding to the internal model
      Parameters:
      votable - SavotVOTable
      file - String
      stream - OutputStream
      Throws:
      IOException
    • initStream

      public void initStream(String file) throws IOException
      Init the Stream for the output
      Parameters:
      file - String
      Throws:
      IOException
    • initStream

      public void initStream(OutputStream stream) throws IOException
      Init the Stream for the output
      Parameters:
      stream - OutputStream
      Throws:
      IOException
    • initStream

      public void initStream(Writer writer)
      Init the Stream for the output using the given Writer
      Parameters:
      writer - writer implementation to write into
    • writeComment

      public void writeComment(String comment) throws IOException
      Write a comment
      Parameters:
      comment - String
      Throws:
      IOException
    • writeDescription

      public void writeDescription(String description) throws IOException
      Write a description
      Parameters:
      description -
      Throws:
      IOException
    • writeDocumentHead

      public void writeDocumentHead(SavotVOTable votable) throws IOException
      Write a VOTable XML head
      Parameters:
      votable -
      Throws:
      IOException
    • writeDocumentEnd

      public void writeDocumentEnd() throws IOException
      Write a VOTable XML end
      Throws:
      IOException
    • writeCoosys

      public void writeCoosys(CoosysSet coosysSet) throws IOException
      Write a COOSYS set
      Parameters:
      coosysSet -
      Throws:
      IOException
    • writeParam

      public void writeParam(ParamSet params) throws IOException
      Write a PARAM set
      Parameters:
      params -
      Throws:
      IOException
    • writeParamRef

      public void writeParamRef(ParamRefSet refparams) throws IOException
      Write a PARAMref set
      Parameters:
      refparams -
      Throws:
      IOException
    • writeLink

      public void writeLink(LinkSet linkSet) throws IOException
      Write a LINK set
      Parameters:
      linkSet -
      Throws:
      IOException
    • writeInfo

      public void writeInfo(InfoSet infoSet) throws IOException
      Write an INFO set
      Parameters:
      infoSet -
      Throws:
      IOException
    • writeField

      public void writeField(FieldSet fieldSet) throws IOException
      Write a FIELD set
      Parameters:
      fieldSet -
      Throws:
      IOException
    • writeFieldRef

      public void writeFieldRef(FieldRefSet fieldRefSet) throws IOException
      Write a FIELD set
      Parameters:
      fieldRefSet -
      Throws:
      IOException
    • writeStream

      public void writeStream(SavotStream stream) throws IOException
      Write a STREAM element
      Parameters:
      stream -
      Throws:
      IOException
    • writeBinary

      public void writeBinary(SavotBinary binary) throws IOException
      Write a BINARY element
      Parameters:
      binary -
      Throws:
      IOException
    • writeValues

      public void writeValues(SavotValues values) throws IOException
      Write a VALUES element
      Parameters:
      values -
      Throws:
      IOException
    • writeFits

      public void writeFits(SavotFits fits) throws IOException
      Write a FITS element
      Parameters:
      fits -
      Throws:
      IOException
    • writeMin

      public void writeMin(SavotMin min) throws IOException
      Write a MIN element
      Parameters:
      min -
      Throws:
      IOException
    • writeMax

      public void writeMax(SavotMax max) throws IOException
      Write a MAX element
      Parameters:
      max -
      Throws:
      IOException
    • writeOption

      public void writeOption(OptionSet optionSet) throws IOException
      Write an OPTION set
      Parameters:
      optionSet -
      Throws:
      IOException
    • writeGroup

      public void writeGroup(GroupSet groupSet) throws IOException
      Write a GROUP set
      Parameters:
      groupSet -
      Throws:
      IOException
    • writeTableBegin

      public void writeTableBegin(SavotTable table) throws IOException
      Write a TABLE begin
      Parameters:
      table - SavotTable
      Throws:
      IOException
    • writeTableEnd

      public void writeTableEnd() throws IOException
      Write a TABLE end
      Throws:
      IOException
    • writeResourceBegin

      public void writeResourceBegin(SavotResource resource) throws IOException
      Write a RESOURCE begin
      Parameters:
      resource - SavotResource
      Throws:
      IOException
    • writeResourceEnd

      public void writeResourceEnd() throws IOException
      Write a RESOURCE end
      Throws:
      IOException
    • writeTableDataBegin

      public void writeTableDataBegin() throws IOException
      Write a TABLEDATA begin
      Throws:
      IOException
    • writeTableDataEnd

      public void writeTableDataEnd() throws IOException
      Write a TABLEDATA end
      Throws:
      IOException
    • writeDataBegin

      public void writeDataBegin() throws IOException
      Write a DATA begin
      Throws:
      IOException
    • writeDataEnd

      public void writeDataEnd() throws IOException
      Write a DATA end
      Throws:
      IOException
    • writeTR

      public void writeTR(SavotTR tr) throws IOException
      Write a TR
      Parameters:
      tr -
      Throws:
      IOException
    • writeResource

      public void writeResource(ResourceSet resourceset) throws IOException
      Write a RESOURCE set
      Parameters:
      resourceset - ResourceSet
      Throws:
      IOException