Package uk.ac.starlink.vo

## Class DataModelAdqlExample

- java.lang.Object
- - uk.ac.starlink.vo.DataModelAdqlExample

- All Implemented Interfaces:
    `AdqlExample`

      public abstract class DataModelAdqlExample
      extends java.lang.Object
      implements AdqlExample

  AdqlExample implementation that provides fixed-text examples specific to a given standard declared data model. The getText method returns a non-null value only if the supplied TapCapability declares a data model that the example recognises.
  Since:
    3 Jun 2015
  Author:
    Mark Taylor

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `DataModelAdqlExample​(java.lang.String name, java.lang.String description, java.lang.String infoUrl)` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static DataModelAdqlExample[]` | `createObsTapExamples()` | Returns a list of examples applicable for the ObsCore data model.
    `static DataModelAdqlExample[]` | `createRegTapExamples()` | Returns a list of examples applicable for the RegTAP data model.
    `java.lang.String` | `getDescription()` | Returns this example's description.
    `java.net.URL` | `getInfoUrl()` | Returns a documentation URL associated with this example if available.
    `java.lang.String` | `getName()` | Returns this example's name.
    `java.lang.String` | `getText​(boolean lineBreaks, java.lang.String lang, TapCapability tcap, TableMeta[] tables, TableMeta table, double[] skypos)` | Produces ADQL text for a query of the type represented by this object, for a given set of service details.
    `protected abstract java.lang.String[]` | `getTextLines​(double[] skypos)` | Returns the lines of ADQL text for this example.
    `abstract boolean` | `isDataModel​(java.lang.String dm)` | Indicates whether a given data model string is the one to which this example corresponds.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### DataModelAdqlExample

          protected DataModelAdqlExample​(java.lang.String name,
                                         java.lang.String description,
                                         java.lang.String infoUrl)

      Constructor.
      Parameters:
        `name` - example name
        `description` - example short description
        `infoUrl` - URL for explanation

  - ### Method Detail

    - #### isDataModel

          public abstract boolean isDataModel​(java.lang.String dm)

      Indicates whether a given data model string is the one to which this example corresponds. The supplied string is the ivo-id attribute of the TAPRegExt `dataModel` attribute, available from `TapCapability.getDataModels()`.
      Parameters:
        `dm` - data model identifier

    - #### getTextLines

          protected abstract java.lang.String[] getTextLines​(double[] skypos)

      Returns the lines of ADQL text for this example.
      Parameters:
        `skypos` - 2-element array giving preferred (RA,Dec) sky position in degrees, or null if none preferred

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `AdqlExample`
      Returns this example's name.
      Specified by:
        `getName` in interface `AdqlExample`
      Returns:
        name

    - #### getDescription

          public java.lang.String getDescription()

      Description copied from interface: `AdqlExample`
      Returns this example's description.
      Specified by:
        `getDescription` in interface `AdqlExample`
      Returns:
        short description

    - #### getInfoUrl

          public java.net.URL getInfoUrl()

      Description copied from interface: `AdqlExample`
      Returns a documentation URL associated with this example if available.
      Specified by:
        `getInfoUrl` in interface `AdqlExample`
      Returns:
        documentation URL (suitable for browser display), or null

    - #### getText

          public java.lang.String getText​(boolean lineBreaks,
                                          java.lang.String lang,
                                          TapCapability tcap,
                                          TableMeta[] tables,
                                          TableMeta table,
                                          double[] skypos)

      Description copied from interface: `AdqlExample`
      Produces ADQL text for a query of the type represented by this object, for a given set of service details.
      Specified by:
        `getText` in interface `AdqlExample`
      Parameters:
        `lineBreaks` - whether output ADQL should include multiline formatting
        `lang` - ADQL language variant (e.g. "ADQL-2.0")
        `tcap` - TAP capability object
        `tables` - table metadata set
        `table` - currently selected table
        `skypos` - 2-element array giving preferred (RA,Dec) sky position in degrees, or null if none preferred
      Returns:
        example text, or null if no example can be constructed given the input values

    - #### createRegTapExamples

          public static DataModelAdqlExample[] createRegTapExamples()

      Returns a list of examples applicable for the RegTAP data model. This list is taken from section 10 of RegTAP 1.0.
      Returns:
        example list
      See Also:
        RegTAP 1.0

    - #### createObsTapExamples

          public static DataModelAdqlExample[] createObsTapExamples()

      Returns a list of examples applicable for the ObsCore data model. These examples are written with reference to Appendix A of ObsCore 1.0, with a few alterations and corrections.
      Returns:
        example list
      See Also:
        ObsCore 1.0