# Class TstTableWriter

java.lang.Object
uk.ac.starlink.table.formats.DocumentedStreamStarTableWriter
uk.ac.starlink.table.formats.TstTableWriter

All Implemented Interfaces:
  `Documented, DocumentedIOHandler, StarTableWriter`

public class TstTableWriter extends DocumentedStreamStarTableWriter
Output handler for Tab-Separated Table format. This is used by GAIA/SkyCat amongst other software. Documentation of the format can be found in Starlink System Note 75 (SSN/75).

Since:
  27 Jul 2006
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`TstTableWriter()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`docIncludesExample()`
Indicates whether the serialization of some (short) example table should be added to the user documentation for this handler.
`String`
`getFormatName()`
Returns "TST".
`String`
`getMimeType()`
Returns "text/plain".
`String`
`getXmlDescription()`
Returns user-directed documentation in XML format.
`void`
`writeStarTable(StarTable st, OutputStream out)`
Writes a `StarTable` object to a given output stream.

### Methods inherited from class DocumentedStreamStarTableWriter

`getExtensions, looksLikeFile, writeStarTable`

### Methods inherited from class Object

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

### Methods inherited from interface DocumentedIOHandler

`readText`

## Constructor Details

### TstTableWriter

public TstTableWriter()

## Method Details

### getFormatName

public String getFormatName()
Returns "TST".

Returns:
  format name

### getMimeType

public String getMimeType()
Returns "text/plain".

Returns:
  MIME type

### docIncludesExample

public boolean docIncludesExample()
Description copied from interface: `DocumentedIOHandler`
Indicates whether the serialization of some (short) example table should be added to the user documentation for this handler. Binary formats, or instances for which the `Documented.getXmlDescription()` method already includes some example output, should return false.

Returns:
  true if the user documentation would benefit from the addition of an example serialization

### getXmlDescription

public String getXmlDescription()
Description copied from interface: `Documented`
Returns user-directed documentation in XML format.

The output should be a sequence of one or more <P> elements, using XHTML-like XML. Since rendering may be done in a number of contexts however, use of the full range of XHTML elements is discouraged. Where possible, the content should stick to simple markup such as the elements P, A, UL, OL, LI, DL, DT, DD EM, STRONG, I, B, CODE, TT, PRE.

Returns:
  XML description of this object

### writeStarTable

public void writeStarTable(StarTable st, OutputStream out) throws IOException
Description copied from interface: `StarTableWriter`
Writes a `StarTable` object to a given output stream. The implementation can assume that `out` is suitable for direct writing (for instance it should not normally wrap it in a `BufferedOutputStream`), and should not close it at the end of the call.

Not all table writers are capable of writing to a stream; an implementation may throw a `TableFormatException` to indicate that it cannot do so.

Parameters:
  `st` - the table to write
  `out` - the output stream to which `startab` should be written
Throws:
  `IOException` - if there is some I/O error