public class LabelValidator extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SCHEMA_CHECK |
static String |
SCHEMATRON_CHECK |
Constructor and Description |
---|
LabelValidator()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addValidator(DocumentValidator validator) |
void |
addValidator(ExternalValidator validator) |
Boolean |
getConfiguration(String key) |
String |
getModelVersion() |
List<String> |
getSchematrons(NodeList nodeList,
URL url,
ExceptionContainer container) |
static void |
main(String[] args) |
Boolean |
performsSchematronValidation() |
Boolean |
performsSchemaValidation() |
void |
setCachedEntityResolver(CachedEntityResolver resolver) |
void |
setCachedLSResourceResolver(CachedLSResourceResolver resolver) |
void |
setCatalogs(String[] catalogFiles)
Pass in a list of Catalog files to use during the validation
step.
|
void |
setConfiguration(String key,
Boolean value) |
void |
setLabelSchematrons(Map<String,Transformer> schematronMap)
Pass in a hash map of schematron URLs to its transformed
schematron object.
|
void |
setModelVersion(String modelVersion) |
void |
setSchema(List<URL> schemaFiles)
Pass in a list of schemas to validate against.
|
void |
setSchemaCheck(Boolean value) |
void |
setSchemaCheck(Boolean value,
Boolean useLabelSchema) |
void |
setSchematronCheck(Boolean value) |
void |
setSchematronCheck(Boolean value,
Boolean useLabelSchematron) |
void |
setSchematronFiles(List<URL> schematronFiles)
Pass in a list of schematron files to validate against.
|
void |
setSchematrons(List<Transformer> schematrons)
Pass in a list of transformed schematrons to validate
against.
|
void |
validate(ExceptionContainer container,
File labelFile) |
void |
validate(ExceptionContainer container,
URL url)
Validates the label against schema and schematron constraints.
|
void |
validate(File labelFile) |
public static final String SCHEMA_CHECK
public static final String SCHEMATRON_CHECK
public LabelValidator() throws ParserConfigurationException, TransformerConfigurationException
ParserConfigurationException
- If there was an error setting up
the configuration of the parser that is reposnible for doing the
label validation.TransformerConfigurationException
- If there was an error setting
up the Transformer responsible for doing the transformations of the
schematrons.public void setSchema(List<URL> schemaFiles)
schemaFiles
- A list of schema URLs.public void setSchematrons(List<Transformer> schematrons)
schematrons
- A list of transformed schematrons.public void setLabelSchematrons(Map<String,Transformer> schematronMap)
schematronMap
- public void setSchematronFiles(List<URL> schematronFiles)
schematronFiles
- A list of schematron URLs.public void setCatalogs(String[] catalogFiles)
catalogFiles
- public void validate(ExceptionContainer container, File labelFile) throws SAXException, IOException, ParserConfigurationException, TransformerException, MissingLabelSchemaException
public void validate(ExceptionContainer container, URL url) throws SAXException, IOException, ParserConfigurationException, TransformerException, MissingLabelSchemaException
container
- to store output messages inurl
- label to validateSAXException
IOException
ParserConfigurationException
TransformerException
MissingLabelSchemaException
public void validate(File labelFile) throws SAXException, IOException, ParserConfigurationException, TransformerException, MissingLabelSchemaException
public List<String> getSchematrons(NodeList nodeList, URL url, ExceptionContainer container)
public String getModelVersion()
public void setModelVersion(String modelVersion) throws ValidatorException
ValidatorException
public Boolean performsSchemaValidation()
public void setSchemaCheck(Boolean value)
public Boolean performsSchematronValidation()
public void setSchematronCheck(Boolean value)
public void addValidator(ExternalValidator validator)
public void addValidator(DocumentValidator validator)
public void setCachedEntityResolver(CachedEntityResolver resolver)
public void setCachedLSResourceResolver(CachedLSResourceResolver resolver)
Copyright © 2010–2015 Planetary Data System. All rights reserved.