Package uk.ac.starlink.vo.datalink
Class LinkColMap
java.lang.Object
uk.ac.starlink.vo.datalink.LinkColMap
Defines the mapping of columns named by the DataLink standard
to a given table.
The usual way to obtain an instance of this class is using the
static getMap
method.
- Since:
- 22 Nov 2017
- Author:
- Mark Taylor
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Utility class that encapsulates the characteristics of a given column from the DataLink standard. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LinkColMap.ColDef
<String> access_url column definition.static final LinkColMap.ColDef
<Number> content_length column definition.static final LinkColMap.ColDef
<String> content_qualifier column definition.static final LinkColMap.ColDef
<String> content_type column definition.static final LinkColMap.ColDef
<String> description column definition.static final LinkColMap.ColDef
<String> error_message column definition.static final LinkColMap.ColDef
<String> ID column definition.static final LinkColMap.ColDef
<String> link_auth column definition.static final LinkColMap.ColDef
<Boolean> link_authorized column definition.static final LinkColMap.ColDef
<Object> local_semantics column definition.static final LinkColMap.ColDef
<String> semantics column definition.static final LinkColMap.ColDef
<String> service_def column definition.static final Map
<String, LinkColMap.ColDef<?>> Map by column name of all columns required in a DataLink table. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LinkColMap
(Map<LinkColMap.ColDef<?>, Integer> icolMap) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetAccessUrl
(Object[] row) Returns the value of the DataLink access_url column in a given row.getContentLength
(Object[] row) Returns the value of the DataLink content_length column in a given row.getContentQualifier
(Object[] row) Returns the value of the DataLink content_qualifier column in a given row.getContentType
(Object[] row) Returns the value of the DataLink content_type column in a given row.getDescription
(Object[] row) Returns the value of the DataLink description column in a given row.getErrorMessage
(Object[] row) Returns the value of the DataLink error_message column in a given row.Returns the value of the DataLink id column in a given row.getLinkAuth
(Object[] row) Returns the value of the DataLink content_auth column in a given row.getLinkAuthorized
(Object[] row) Returns the declared authorization status for a given row.getLocalSemantics
(Object[] row) Returns the local semantics value for a given row.static LinkColMap
getMap
(uk.ac.starlink.table.StarTable table) Constructs a LinkColMap that knows where the DataLink columns are in a supplied table.getSemantics
(Object[] row) Returns the value of the DataLink semantics column in a given row.getServiceDef
(Object[] row) Returns the value of the DataLink service_def column in a given row.<C> C
getValue
(LinkColMap.ColDef<C> col, Object[] row) Returns the typed corresponding to a given column definition in a given row.
-
Field Details
-
COL_ID
ID column definition. -
COL_ACCESSURL
access_url column definition. -
COL_SERVICEDEF
service_def column definition. -
COL_ERRORMESSAGE
error_message column definition. -
COL_DESCRIPTION
description column definition. -
COL_SEMANTICS
semantics column definition. -
COL_CONTENTTYPE
content_type column definition. -
COL_CONTENTLENGTH
content_length column definition. -
COL_CONTENTQUALIFIER
content_qualifier column definition. -
COL_LOCALSEMANTICS
local_semantics column definition. -
COL_LINKAUTH
link_auth column definition. -
COL_LINKAUTHORIZED
link_authorized column definition. -
COLDEF_MAP
Map by column name of all columns required in a DataLink table.
-
-
Constructor Details
-
LinkColMap
Constructor.- Parameters:
icolMap
- map from column definition to column index, providing the state of this object
-
-
Method Details
-
getId
Returns the value of the DataLink id column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
id
column
-
getAccessUrl
Returns the value of the DataLink access_url column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
access_url
column
-
getServiceDef
Returns the value of the DataLink service_def column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
service_def
column
-
getErrorMessage
Returns the value of the DataLink error_message column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
error_message
column
-
getDescription
Returns the value of the DataLink description column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
description
column
-
getSemantics
Returns the value of the DataLink semantics column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
semantics
column
-
getContentType
Returns the value of the DataLink content_type column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
content_type
column
-
getContentLength
Returns the value of the DataLink content_length column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
content_length
column, may be null
-
getContentQualifier
Returns the value of the DataLink content_qualifier column in a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
content_qualifier
column
-
getLocalSemantics
Returns the local semantics value for a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- object corresponding to the cell value for the experimental
local_semantics
column, may be null
-
getLinkAuth
Returns the value of the DataLink content_auth column in a given row. This is supposed to be one of "false
", "optional
", "true
" or null.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- cell value for the
content_auth
column
-
getLinkAuthorized
Returns the declared authorization status for a given row.- Parameters:
row
- row from the table for which this map was prepared- Returns:
- boolean corresponding to the cell value for the
link_authorized
column, may be null
-
getValue
Returns the typed corresponding to a given column definition in a given row.- Parameters:
col
- column value extractor objectrow
- row from the table for which this map was prepared- Returns:
- typed cell value for
col
-
getMap
Constructs a LinkColMap that knows where the DataLink columns are in a supplied table. Columns are identified by name and content type. Incorrect UCDs etc lead to warnings emitted through the logging system. No check is made that all columns are present; attempts to retrieve column values for unidentified columns just return null.- Parameters:
table
- table (assumed DataLink) to interpret- Returns:
- column map object
-