# Class TableMetadataStage

java.lang.Object
uk.ac.starlink.ttools.taplint.TableMetadataStage

All Implemented Interfaces:
  `MetadataHolder, Stage`

Direct Known Subclasses:
  `TablesEndpointStage, TapSchemaStage`

public abstract class TableMetadataStage extends Object implements Stage, MetadataHolder
Validation stage for checking the content of parsed Table metadata. Concrete subclasses must provide a method to acquire the metadata as an array of TableMeta objects.

Since:
  3 Jun 2011
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`TableMetadataStage(String srcDescription, String[] knownColFlags, boolean reportOtherFlags)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDescription()`
Returns a short one-line description of this stage.
`String`
`getSourceDescription()`
Returns a short text description of table metadata source.
`uk.ac.starlink.vo.SchemaMeta[]`
`getTableMetadata()`
Returns the table metadata obtained by the last run of this stage.
`boolean`
`hasDetail()`
Indicates whether column/key metadata was obtained by the last run of this stage.
`protected abstract MetadataHolder`
`readTableMetadata(Reporter reporter, uk.ac.starlink.vo.TapService tapService)`
Reads an object providing table metadata to check.
`void`
`run(Reporter reporter, uk.ac.starlink.vo.TapService tapService)`
Performs the validation checks for this stage.
`void`
`setTableFilter(Predicate<uk.ac.starlink.vo.TableMeta> tableFilter)`
Installs a filter that restricts reported metadata to only selected tables.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TableMetadataStage

public TableMetadataStage(String srcDescription, String[] knownColFlags, boolean reportOtherFlags)
Constructor.

Parameters:
  `srcDescription` - short text description of table metadata source
  `knownColFlags` - standard column flag values to report counts for
  `reportOtherFlags` - whether to report counts for non-standard column flag values

## Method Details

### getDescription

public String getDescription()
Description copied from interface: `Stage`
Returns a short one-line description of this stage.

Specified by:
  `getDescription` in interface `Stage`
Returns:
  description in imperative mood

### getSourceDescription

public String getSourceDescription()
Returns a short text description of table metadata source.

Returns:
  metadata source description

### getTableMetadata

public uk.ac.starlink.vo.SchemaMeta[] getTableMetadata()
Returns the table metadata obtained by the last run of this stage.

Specified by:
  `getTableMetadata` in interface `MetadataHolder`
Returns:
  table metadata array

### hasDetail

public boolean hasDetail()
Indicates whether column/key metadata was obtained by the last run of this stage.

Specified by:
  `hasDetail` in interface `MetadataHolder`
Returns:
  true iff getTableMetadata result has applicable column detail

### setTableFilter

public void setTableFilter(Predicate<uk.ac.starlink.vo.TableMeta> tableFilter)
Installs a filter that restricts reported metadata to only selected tables. If a non-null filter has been set at `run(Reporter, TapService)` time, subsequent calls to `getTableMetadata()` will return metadata referencing only those tables passed by the filter.

Parameters:
  `tableFilter` - table selection, or null for unrestricted

### readTableMetadata

protected abstract MetadataHolder readTableMetadata(Reporter reporter, uk.ac.starlink.vo.TapService tapService)
Reads an object providing table metadata to check.

Parameters:
  `reporter` - destination for messages
  `tapService` - TAP service description
Returns:
  fully populated metadata object

### run

public void run(Reporter reporter, uk.ac.starlink.vo.TapService tapService)
Description copied from interface: `Stage`
Performs the validation checks for this stage.

Specified by:
  `run` in interface `Stage`
Parameters:
  `reporter` - destination for validation messages
  `tapService` - TAP service description