# Class ObsTapStage

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

All Implemented Interfaces:
  `Stage`

public class ObsTapStage extends Object implements Stage
Validation stage for testing ObsCore data model metadata and content.

Since:
  24 Nov 2011
Author:
  Mark Taylor
See Also:
  - IVOA Observation Data Model

## Constructor Summary

Constructors
Constructor
Description
`ObsTapStage(TapRunner tapRunner, CapabilityHolder capHolder, MetadataHolder metaHolder)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDescription()`
Returns a short one-line description of this stage.
`static String`
`nameKey(String name)`
Normalises a column name to produce a value suitable for use as a Map key.
`void`
`run(Reporter reporter, uk.ac.starlink.vo.TapService tapService)`
Performs the validation checks for this stage.
`static Map<String, uk.ac.starlink.vo.ColumnMeta>`
`toMap(uk.ac.starlink.vo.ColumnMeta[] cols)`
Converts an array of ColumnMeta objects into a name->value map.

### Methods inherited from class Object

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

## Constructor Details

### ObsTapStage

public ObsTapStage(TapRunner tapRunner, CapabilityHolder capHolder, MetadataHolder metaHolder)
Constructor.

Parameters:
  `tapRunner` - runs TAP queries
  `capHolder` - provides capability metadata at runtime
  `metaHolder` - provides table metadata at runtime

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

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

### toMap

public static Map<String, uk.ac.starlink.vo.ColumnMeta> toMap(uk.ac.starlink.vo.ColumnMeta[] cols)
Converts an array of ColumnMeta objects into a name->value map. The `nameKey(String)` method is used to normalise the column name.

Parameters:
  `cols` - column metadata list
Returns:
  map of normalised column name to column metadata object

### nameKey

public static String nameKey(String name)
Normalises a column name to produce a value suitable for use as a Map key.

Parameters:
  `name` - column name
Returns:
  map-friendly value identifying `name`