Package uk.ac.starlink.ttools.votlint
Class VocabChecker
- java.lang.Object
-
- uk.ac.starlink.ttools.votlint.VocabChecker
-
public class VocabChecker extends java.lang.Object
Checks values that are defined by the content of an IVOA Vocabulary.- Since:
- 25 Apr 2019
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
VocabChecker.TermReporter
Callback interface for reporting vocabulary interrogation results.
-
Field Summary
Fields Modifier and Type Field Description static VocabChecker
REFPOSITION
Instance for vocabulary at http://www.ivoa.net/rdf/refposition.static VocabChecker
TIMESCALE
Instance for vocabulary at http://www.ivoa.net/rdf/timescale.
-
Constructor Summary
Constructors Constructor Description VocabChecker(java.lang.String vocabUrl, java.lang.String[] fixedTerms)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkTerm(java.lang.String value, VocabChecker.TermReporter termReporter)
Checks whether a term is present in this vocabulary, and reports to a callback interface.java.util.Collection<java.lang.String>
getFixedTerms()
Returns the hard-coded list of terms known by this checker.java.util.Map<java.lang.String,uk.ac.starlink.vo.VocabTerm>
getRetrievedTerms()
Lazily acquires vocabulary values by reading the resource at the vocabulary URI.java.net.URL
getVocabularyUrl()
Returns the URI/URL of this object's vocabulary.
-
-
-
Field Detail
-
TIMESCALE
public static final VocabChecker TIMESCALE
Instance for vocabulary at http://www.ivoa.net/rdf/timescale.
-
REFPOSITION
public static final VocabChecker REFPOSITION
Instance for vocabulary at http://www.ivoa.net/rdf/refposition.
-
-
Constructor Detail
-
VocabChecker
public VocabChecker(java.lang.String vocabUrl, java.lang.String[] fixedTerms)
Constructor.- Parameters:
vocabUrl
- URI/URL for vocabulary documentfixedTerms
- hard-coded non-preliminary, non-deprecated terms known in the vocabulary; other terms may be available by resolving the vocabulary URL
-
-
Method Detail
-
checkTerm
public void checkTerm(java.lang.String value, VocabChecker.TermReporter termReporter)
Checks whether a term is present in this vocabulary, and reports to a callback interface.- Parameters:
value
- vocabulary name item to testtermReporter
- destination for reports; exactly one of its methods will be invoked
-
getVocabularyUrl
public java.net.URL getVocabularyUrl()
Returns the URI/URL of this object's vocabulary.- Returns:
- vocabulary URL
-
getFixedTerms
public java.util.Collection<java.lang.String> getFixedTerms()
Returns the hard-coded list of terms known by this checker. It may not be complete if this class is out of date with respect to the vocabulary itself.- Returns:
- unmodifiable list of known terms
-
getRetrievedTerms
public java.util.Map<java.lang.String,uk.ac.starlink.vo.VocabTerm> getRetrievedTerms()
Lazily acquires vocabulary values by reading the resource at the vocabulary URI.- Returns:
- term map retrieved from online vocabulary; in case of a read error this may be empty, but not null
-
-