Class 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 Detail

      • SavotWriter

        public SavotWriter()
        Public constructor
    • 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 model
        stream - 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 model
        file - 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 - SavotVOTable
        file - String
        stream - 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