uk.ac.starlink.gbin

## Interface GbinTableProfile

- All Known Implementing Classes:
    DefaultGbinTableProfile

      public interface GbinTableProfile

  Parameterises the way that a GBIN object is turned into a StarTable by the STIL input handler.
  Since:
    13 Aug 2014

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Representation<?>` | `createRepresentation(java.lang.Class<?> clazz)` Returns an object which can represent a particular data type returned from an accessor method of a GBIN object (or one of its descendants).
    `java.lang.String[]` | `getIgnoreMethodDeclaringClasses()` Returns the list of method-declaring classnames for which the corresponding methods will be ignored when coming up with a list of columns for an object.
    `java.lang.String[]` | `getIgnoreMethodNames()` Returns the list of method names to ignore when coming up with a list of columns for an object.
    `java.lang.String` | `getNameSeparator()` Returns the separation string used to delimit parts of column hierarchical names.
    `boolean` | `isHierarchicalNames()` Indicates whether column names in the output table should be forced to reflect the compositional hierarchy of their position in the element objects.
    `boolean` | `isReadMeta()` Indicates whether non-essential metadata is read from the GBIN file.
    `boolean` | `isSortedMethods()` Indicates whether object accessor method names should be sorted alphabetically when producing the column sequence.
    `boolean` | `isTestMagic()` Indicates whether the magic number is read from GBIN files before attempting to turn them into tables.

- - ### Method Detail

    - #### isReadMeta

          boolean isReadMeta()

      Indicates whether non-essential metadata is read from the GBIN file. This includes amongst other things the row count and a description of the data. Because of the way GBIN reading works, reading metadata requires acquisition of a new InputStream (it can't be done using the same stream that reads the data objects) so it may be expensive.
      Returns:
        true to attempt to read metadata where possible

    - #### isTestMagic

          boolean isTestMagic()

      Indicates whether the magic number is read from GBIN files before attempting to turn them into tables. It's probably a good idea to set this true, but there may be GBIN variants for which the magic number testing supplied gives false negatives, in which case you'd want to turn it off.
      Returns:
        true if you want magic number mismatch to cause read failure

    - #### isHierarchicalNames

          boolean isHierarchicalNames()

      Indicates whether column names in the output table should be forced to reflect the compositional hierarchy of their position in the element objects. If set true, columns will have names like "Astrometry_Alpha", if false they may just be called "Alpha". In case of name duplication however, the hierarchical form is always used.
      Returns:
        true to force use of hierarchical column names

    - #### getNameSeparator

          java.lang.String getNameSeparator()

      Returns the separation string used to delimit parts of column hierarchical names. If the value is "_" you may see column names like "Astrometry_Alpha". An empty string is permissible too.
      Returns:
        column hierarchical name separator string

    - #### isSortedMethods

          boolean isSortedMethods()

      Indicates whether object accessor method names should be sorted alphabetically when producing the column sequence. Otherwise `get*` method names will be used in whatever sequence reflection provides them in, which according to the `Class.getMethods()` javadocs is "not sorted and are not in any particular order".
      Returns:
        true to sort method names alphabetically

    - #### getIgnoreMethodNames

          java.lang.String[] getIgnoreMethodNames()

      Returns the list of method names to ignore when coming up with a list of columns for an object. Any methods matching strings in the return value will not be used to generate columns in an output table. Only public instance methods of the form `getXxx()` or `isXxx()` are used in any case. The restrictions determined by `getIgnoreMethodDeclaringClasses()` also apply.
      Returns:
        list of accessor method names to ignore

    - #### getIgnoreMethodDeclaringClasses

          java.lang.String[] getIgnoreMethodDeclaringClasses()

      Returns the list of method-declaring classnames for which the corresponding methods will be ignored when coming up with a list of columns for an object. Any method `m` for which `m.getDeclaringClass()` returns a class whose name is returned by this method will not be used to generate columns in an output table. Only public instance methods of the form `getXxx()` or `isXxx()` are used in any case. The restrictions determined by `getIgnoreMethodNames()` also apply.
      Returns:
        list of declaring classes whose methods are to be ignored

    - #### createRepresentation

          Representation<?> createRepresentation(java.lang.Class<?> clazz)

      Returns an object which can represent a particular data type returned from an accessor method of a GBIN object (or one of its descendants). If null is returned, the object should not appear in the output table at all.
      Parameters:
        `clazz` - return type of an accessor method
      Returns:
        object indicating how accessed objects should appear in the output table; null to truncate the hierarchy here