Class EcsvTableBuilder

java.lang.Object
uk.ac.starlink.table.formats.DocumentedTableBuilder
uk.ac.starlink.ecsv.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 Details

    • EcsvTableBuilder

      public EcsvTableBuilder()
      Constructor.
  • Method Details

    • getFormatName

      public String getFormatName()
    • canImport

      public boolean canImport(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", sequence=1) public void setHeader(String headerLoc)
      Sets the location of a header file which will be prepended to any file read by this handler. It can be set 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
    • getHeader

      public String getHeader()
      Returns the location of a header file which will be prepended to any file read by this handler.
      Returns:
      header file location
    • 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", sequence=2) public void setColcheck(MessagePolicy colCheck)
    • getColcheck

      public MessagePolicy getColcheck()
      Returns the column checking message policy.
      Returns:
      determines action if YAML header columns don't match CSV header
    • streamStarTable

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

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

      public String getXmlDescription()
    • canStream

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

      public boolean docIncludesExample()