Package uk.ac.starlink.ecsv

# 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 Summary

Constructors
Constructor
Description
`EcsvTableBuilder()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canImport(DataFlavor flavor)`
`boolean`
`canStream()`
`boolean`
`docIncludesExample()`
`String`
`getFormatName()`
`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(String headerLoc)`
Sets the location of a header file which will be prepended to any file read by this handler.
`void`
`streamStarTable(InputStream in, uk.ac.starlink.table.TableSink sink, 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 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 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", sequence=2) public void setColcheck(MessagePolicy colCheck)

### 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()