Package uk.ac.starlink.ttools.taplint
Class DatalinkValidator
java.lang.Object
uk.ac.starlink.ttools.taplint.DatalinkValidator
Performs validation of DataLink documents.
A
Reporter instance is supplied at construction time,
and all validation reports are reported via that object.
The DataLink document is loaded as a DOM rather than using SAX to stream it. DataLink documents are expected to be of a fairly manageable size, so this should be OK.
- Since:
- 23 Nov 2017
- Author:
- Mark Taylor
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDatalinkValidator(Reporter reporter, uk.ac.starlink.vo.DatalinkVersion version) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionuk.ac.starlink.vo.datalink.LinksDoccreateLinksDoc(uk.ac.starlink.votable.VODocument vodoc, uk.ac.starlink.vo.DatalinkVersion version) Parses a VOTable document as a DataLink structure, reporting any validation issues as it does.voidPerforms checks on a DataLink document read from a given input stream.voidvalidateDatalink(URL url, boolean isLinksService, boolean mustSucceed) Performs checks on a DataLink document obtained from a URL.voidvalidateDatalink(uk.ac.starlink.votable.VODocument vodoc, uk.ac.starlink.vo.DatalinkVersion version) Performs DataLink-specific validation on a VOTable DOM.voidvalidateLinksDoc(uk.ac.starlink.vo.datalink.LinksDoc linksDoc, uk.ac.starlink.vo.DatalinkVersion version) Performs checks on a LinksDoc object.
-
Constructor Details
-
DatalinkValidator
Constructor.- Parameters:
reporter- destination for validation methodsversion- fixed datalink version to validate against; may be null if not known/specified
-
-
Method Details
-
validateDatalink
Performs checks on a DataLink document obtained from a URL.The supplied URL is assumed to refer to a GET request expected to return a DataLink document, and with no RESPONSEFORMAT parameter (which means that the result must be a TABLEDATA-serialization VOTable). Checks on the HTTP and DALI behaviour are run in addition to the DataLink checks themselves. Additional checks may be performed if the service is asserted to be a DataLink {links} service.
- Parameters:
url- document URLisLinksService- true iff the service is supposed to conform to ivo://ivoa.net/std/DataLink#links-1.0mustSucceed- if true, the service is not supposed to return an error response
-
validateDatalink
Performs checks on a DataLink document read from a given input stream.The supplied InputStream is assumed to be the result of a DataLink request with no RESPONSEFORMAT parameter, which means that the result must a TABLEDATA-serialization VOTable.
- Parameters:
in- input stream
-
validateDatalink
public void validateDatalink(uk.ac.starlink.votable.VODocument vodoc, uk.ac.starlink.vo.DatalinkVersion version) Performs DataLink-specific validation on a VOTable DOM.- Parameters:
vodoc- DOM assumed to contain a document conforming to the DataLink standardversion- datalink version, not null
-
validateLinksDoc
public void validateLinksDoc(uk.ac.starlink.vo.datalink.LinksDoc linksDoc, uk.ac.starlink.vo.DatalinkVersion version) Performs checks on a LinksDoc object. This performs additional validation on an object which has already been parsed as a DataLink document.- Parameters:
linksDoc- object representing DataLink documentversion- datalink specification version, not null
-
createLinksDoc
public uk.ac.starlink.vo.datalink.LinksDoc createLinksDoc(uk.ac.starlink.votable.VODocument vodoc, uk.ac.starlink.vo.DatalinkVersion version) Parses a VOTable document as a DataLink structure, reporting any validation issues as it does.- Parameters:
vodoc- DOM assumed to conform to DataLink rulesversion- datalink version- Returns:
- parsed represntation of the DataLink document
-