public class DatalinkValidator extends Object
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.
| Constructor and Description |
|---|
DatalinkValidator(Reporter reporter,
DatalinkVersion version)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
LinksDoc |
createLinksDoc(VODocument vodoc,
DatalinkVersion version)
Parses a VOTable document as a DataLink structure, reporting any
validation issues as it does.
|
void |
validateDatalink(InputStream in)
Performs checks on a DataLink document read from a given input stream.
|
void |
validateDatalink(URL url,
boolean isLinksService,
boolean mustSucceed)
Performs checks on a DataLink document obtained from a URL.
|
void |
validateDatalink(VODocument vodoc,
DatalinkVersion version)
Performs DataLink-specific validation on a VOTable DOM.
|
void |
validateLinksDoc(LinksDoc linksDoc,
DatalinkVersion version)
Performs checks on a LinksDoc object.
|
public DatalinkValidator(Reporter reporter, DatalinkVersion version)
reporter - destination for validation methodsversion - fixed datalink version to validate against;
may be null if not known/specifiedpublic void validateDatalink(URL url, boolean isLinksService, boolean mustSucceed)
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.
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 responsepublic void validateDatalink(InputStream in)
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.
in - input streampublic void validateDatalink(VODocument vodoc, DatalinkVersion version)
vodoc - DOM assumed to contain a document conforming to
the DataLink standardversion - datalink version, not nullpublic void validateLinksDoc(LinksDoc linksDoc, DatalinkVersion version)
linksDoc - object representing DataLink documentversion - datalink specification version, not nullpublic LinksDoc createLinksDoc(VODocument vodoc, DatalinkVersion version)
vodoc - DOM assumed to conform to DataLink rulesversion - datalink versionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.