uk.ac.starlink.table.formats

## Class DocumentedTableBuilder

- java.lang.Object
- - uk.ac.starlink.table.formats.DocumentedTableBuilder

- All Implemented Interfaces:
    Documented, DocumentedIOHandler, TableBuilder
  Direct Known Subclasses:
    AsciiTableBuilder, CdfTableBuilder, ColFitsTableBuilder, CsvTableBuilder, EcsvTableBuilder, FeatherTableBuilder, FitsTableBuilder, GbinTableBuilder, IpacTableBuilder, MrtTableBuilder, ParquetTableBuilder, TstTableBuilder, VOTableBuilder, WDCTableBuilder

      public abstract class DocumentedTableBuilder
      extends java.lang.Object
      implements TableBuilder, DocumentedIOHandler

  Partial TableBuilder implementation that adds some behaviour useful when auto-generating XML user documentation for I/O handlers.
  Since:
    18 Sep 2020

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DocumentedTableBuilder(java.lang.String[] extensions)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `canStream()` Indicates whether this handler can read tables from a stream.
    `java.lang.String[]` | `getExtensions()` Returns the list of filename extensions recognised by this handler.
    `boolean` | `looksLikeFile(java.lang.String filename)` Indicates whether the given location string is of a familiar form for this builder.

    - ### 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.TableBuilder

      `canImport, getFormatName, makeStarTable, streamStarTable`

    - ### Methods inherited from interface uk.ac.starlink.table.formats.DocumentedIOHandler

      `docIncludesExample, matchesExtension, readText, toLink`

    - ### Methods inherited from interface uk.ac.starlink.table.Documented

      `getXmlDescription`

- - ### Constructor Detail

    - #### DocumentedTableBuilder

          protected DocumentedTableBuilder(java.lang.String[] extensions)

      Constructor.
      Parameters:
        `extensions` - list of lower-cased filename extensions, excluding the '.' character

  - ### Method Detail

    - #### getExtensions

          public java.lang.String[] getExtensions()

      Description copied from interface: `DocumentedIOHandler`
      Returns the list of filename extensions recognised by this handler.
      Specified by:
        `getExtensions` in interface `DocumentedIOHandler`
      Returns:
        lower-cased filename extension strings, no "." characters

    - #### looksLikeFile

          public boolean looksLikeFile(java.lang.String filename)

      Description copied from interface: `TableBuilder`
      Indicates whether the given location string is of a familiar form for this builder. Implementations should return `true` if there is a good chance that a file with the given `location` can be interpreted by this reader, for instance if it has a suitable file extension.

      This method may be used to guess, on a best-efforts basis, whether this builder is suitable for reading a file from a given location. Attempts may still be made to read inputs for which this method returns false. It is less important for builders that can recognise files by magic number, which is generally preferable to using filenames.

      Specified by:
        `looksLikeFile` in interface `TableBuilder`
      Parameters:
        `filename` - the location string, such as a filename or URL (not null)
      Returns:
        true iff there is a good chance that the named input can be interpreted by this reader

    - #### canStream

          public abstract boolean canStream()

      Indicates whether this handler can read tables from a stream.
      Returns:
        true iff this handler can read from streams