public abstract class LinksDoc extends Object
ivo://ivoa.net/std/DataLink#links-1.*"application/x-votable+xml;content=datalink"An instance of this class gives you what you need to work with a Links service response.
This class simply aggregates three items: the table, column map, and service descriptors. However it also has some static utility methods that are useful for creating and working with datalink tables.
| Constructor and Description |
|---|
LinksDoc() |
| Modifier and Type | Method and Description |
|---|---|
static LinksDoc |
createLinksDoc(StarTable table)
Returns a LinksDoc based on a supplied table.
|
static LinksDoc |
createLinksDoc(StarTable resultTable,
LinkColMap colMap,
ServiceDescriptor[] servDescriptors)
Creates a LinksDoc with fixed members.
|
static LinksDoc |
createLinksDoc(VOElement el)
Parses a VOElement as a LinksDoc.
|
abstract LinkColMap |
getColumnMap()
Returns an object that knows where the DataLink-defined columns
are in this document's table.
|
abstract StarTable |
getResultTable()
Returns the results table.
|
abstract ServiceDescriptor[] |
getServiceDescriptors()
Returns a list of the ServiceDescriptor objects defined by
RESOURCES with @type="meta" and @utype="adhoc:service".
|
static ServiceDescriptor[] |
getServiceDescriptors(StarTable table)
Utility method to extract a list of service descriptors associated
with a given StarTable.
|
static boolean |
isLinksResponse(StarTable table,
int nMistake)
Indicates whether the table in question looks like a Links-response
table.
|
static LinksDoc |
randomAccess(LinksDoc ldoc)
Returns a LinksDoc with the same content as a given one,
for which the result table is guaranteed to support random access.
|
public abstract StarTable getResultTable()
public abstract LinkColMap getColumnMap()
public abstract ServiceDescriptor[] getServiceDescriptors()
public static LinksDoc createLinksDoc(StarTable resultTable, LinkColMap colMap, ServiceDescriptor[] servDescriptors)
resultTable - results tablecolMap - object that understands which columns mean what
in the resultTableservDescriptors - list of service descriptor objects
associated with the tablepublic static LinksDoc createLinksDoc(StarTable table)
There is no guarantee that the result will be represent a useful DataLink document, for instance it may have none of the required DataLink columns.
table - assumed DataLink results tablepublic static LinksDoc createLinksDoc(VOElement el) throws IOException
There is no guarantee that the result will be represent a useful DataLink document, for instance it may have none of the required DataLink columns.
el - VOTable DOM element that contains RESOURCES corresponding
to DataLink data and metadataIOException - if the element structure does not contain a
unique results tablepublic static LinksDoc randomAccess(LinksDoc ldoc) throws IOException
ldoc - input links docIOExceptionpublic static ServiceDescriptor[] getServiceDescriptors(StarTable table)
table - input tablepublic static boolean isLinksResponse(StarTable table, int nMistake)
LinkColMap.COLDEF_MAP).
If the number of missing/incorrect columns does not exceed a given
tolerance, and at least one of the columns access_url,
error_message and service_def is present
and usable, true is returned.table - table to testnMistake - maximum number of incorrect/missing columns tolerated;
2 might be a reasonable number?Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.