public class DatalinkValidator
extends java.lang.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 | Description |
---|---|
DatalinkValidator(Reporter reporter) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
uk.ac.starlink.vo.datalink.LinksDoc |
createLinksDoc(uk.ac.starlink.votable.VODocument vodoc) |
Parses a VOTable document as a DataLink structure, reporting any
validation issues as it does.
|
void |
validateDatalink(java.io.InputStream in) |
Performs checks on a DataLink document read from a given input stream.
|
void |
validateDatalink(java.net.URL url,
boolean isLinksService,
boolean mustSucceed) |
Performs checks on a DataLink document obtained from a URL.
|
void |
validateDatalink(uk.ac.starlink.votable.VODocument vodoc) |
Performs DataLink-specific validation on a VOTable DOM.
|
void |
validateLinksDoc(uk.ac.starlink.vo.datalink.LinksDoc linksDoc) |
Performs checks on a LinksDoc object.
|
public DatalinkValidator(Reporter reporter)
reporter
- destination for validation methodspublic void validateDatalink(java.net.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(java.io.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(uk.ac.starlink.votable.VODocument vodoc)
vodoc
- DOM assumed to contain a document conforming to
the DataLink standardpublic void validateLinksDoc(uk.ac.starlink.vo.datalink.LinksDoc linksDoc)
linksDoc
- object representing DataLink documentpublic uk.ac.starlink.vo.datalink.LinksDoc createLinksDoc(uk.ac.starlink.votable.VODocument vodoc)
vodoc
- DOM assumed to conform to DataLink rulesCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.