Class EcsvTableBuilder

  • All Implemented Interfaces:
    uk.ac.starlink.table.Documented, uk.ac.starlink.table.formats.DocumentedIOHandler, uk.ac.starlink.table.TableBuilder

    public class EcsvTableBuilder
    extends uk.ac.starlink.table.formats.DocumentedTableBuilder
    TableBuilder implementation for ECSV tables. The format currently supported is ECSV 1.0, as documented at Astropy APE6 (V1.0 DOI:10.5281/zenodo.4792325).
    Since:
    29 Apr 2020
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      EcsvTableBuilder()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canImport​(java.awt.datatransfer.DataFlavor flavor)  
      boolean canStream()  
      boolean docIncludesExample()  
      java.lang.String getFormatName()  
      java.lang.String getXmlDescription()  
      uk.ac.starlink.table.StarTable makeStarTable​(uk.ac.starlink.util.DataSource datsrc, boolean wantRandom, uk.ac.starlink.table.StoragePolicy storagePolicy)  
      void setColcheck​(MessagePolicy colCheck)  
      void setHeader​(java.lang.String headerLoc)
      Sets the location of a header file which will be prepended to any file read by this handler.
      void streamStarTable​(java.io.InputStream in, uk.ac.starlink.table.TableSink sink, java.lang.String pos)  
      • Methods inherited from class uk.ac.starlink.table.formats.DocumentedTableBuilder

        getExtensions, looksLikeFile
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface uk.ac.starlink.table.formats.DocumentedIOHandler

        readText
    • Constructor Detail

      • EcsvTableBuilder

        public EcsvTableBuilder()
        Constructor.
    • Method Detail

      • getFormatName

        public java.lang.String getFormatName()
      • canImport

        public boolean canImport​(java.awt.datatransfer.DataFlavor flavor)
      • setHeader

        @ConfigMethod(property="header",
                      doc="<p>Location of a file containing a header to be applied\nto the start of the input file.\nBy using this you can apply your own ECSV-format metadata\nto plain CSV files.\n</p>",
                      usage="<filename-or-url>",
                      example="http://cdn.gea.esac.esa.int/Gaia/gedr3/ECSV_headers/gaia_source.header")
        public void setHeader​(java.lang.String headerLoc)
        Sets the location of a header file which will be prepended to any file read by this handler. It can be ste to a file containing an ECSV header, so that this handler can read plain CSV files but include prepared YAML metadata.
        Parameters:
        headerLoc - filename or URL pointing to a header file
      • setColcheck

        @ConfigMethod(property="colcheck",
                      doc="<p>Determines the action taken if the columns named\nin the YAML header differ from the columns named in the\nfirst line of the CSV part of the file.\n</p>",
                      example="FAIL")
        public void setColcheck​(MessagePolicy colCheck)
      • streamStarTable

        public void streamStarTable​(java.io.InputStream in,
                                    uk.ac.starlink.table.TableSink sink,
                                    java.lang.String pos)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • makeStarTable

        public uk.ac.starlink.table.StarTable makeStarTable​(uk.ac.starlink.util.DataSource datsrc,
                                                            boolean wantRandom,
                                                            uk.ac.starlink.table.StoragePolicy storagePolicy)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getXmlDescription

        public java.lang.String getXmlDescription()
      • canStream

        public boolean canStream()
        Specified by:
        canStream in class uk.ac.starlink.table.formats.DocumentedTableBuilder
      • docIncludesExample

        public boolean docIncludesExample()