Package gov.nasa.pds.validate
Class Validator
- java.lang.Object
-
- gov.nasa.pds.validate.Validator
-
public abstract class Validator extends Object
Abstract class to validate a PDS4 product label.- Author:
- mcayanan
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>catalogsA list of user specified catalogs to use during validation.protected booleanforceFlag to force validation against a label's schema and schematron.protected LabelValidatorlabelValidatorLabelValidator object.protected ReportreportAn object representation of a report to capture the results of validation.protected List<String>schemasA list of user specified schemas to validate against.protected SchematronTransformerschematronTransformerA SchematronTransformer object.protected SchemaValidatorschemaValidatorSchema validator.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddValidator(DocumentValidator validator)voidsetCachedEntityResolver(CachedEntityResolver resolver)voidsetCachedLSResourceResolver(CachedLSResourceResolver resolver)voidsetCatalogs(List<String> catalogs)Sets the catalogs to use during validation.voidsetForce(boolean value)voidsetSchemas(List<URL> schemaFiles)Sets the schemas to use during validation.voidsetSchematrons(List<String> schematrons)Sets the schematrons to use during validation.abstract voidvalidate(File file)Validate a PDS product.abstract voidvalidate(URL url)
-
-
-
Field Detail
-
report
protected Report report
An object representation of a report to capture the results of validation.
-
catalogs
protected List<String> catalogs
A list of user specified catalogs to use during validation.
-
labelValidator
protected LabelValidator labelValidator
LabelValidator object.
-
force
protected boolean force
Flag to force validation against a label's schema and schematron.
-
schemaValidator
protected SchemaValidator schemaValidator
Schema validator.
-
schematronTransformer
protected SchematronTransformer schematronTransformer
A SchematronTransformer object.
-
-
Constructor Detail
-
Validator
public Validator(String modelVersion, Report report) throws ParserConfigurationException, ValidatorException, TransformerConfigurationException
Constructor.- Parameters:
modelVersion- The model version to use for validation.report- A Report object to output the results of the validation run.- Throws:
ParserConfigurationExceptionValidatorExceptionTransformerConfigurationException
-
-
Method Detail
-
setSchemas
public void setSchemas(List<URL> schemaFiles) throws SAXException
Sets the schemas to use during validation. By default, the validation comes pre-loaded with schemas to use. This method would only be used in cases where the user wishes to use their own set of schemas for validation.- Parameters:
schemaFiles- A list of schema files.- Throws:
SAXException
-
setSchematrons
public void setSchematrons(List<String> schematrons)
Sets the schematrons to use during validation.- Parameters:
schematrons- A list of schematrons.
-
setCachedEntityResolver
public void setCachedEntityResolver(CachedEntityResolver resolver)
-
setCachedLSResourceResolver
public void setCachedLSResourceResolver(CachedLSResourceResolver resolver)
-
setCatalogs
public void setCatalogs(List<String> catalogs)
Sets the catalogs to use during validation.- Parameters:
catalogs- A list of catalog files.
-
setForce
public void setForce(boolean value)
-
addValidator
public void addValidator(DocumentValidator validator)
-
validate
public abstract void validate(File file) throws Exception
Validate a PDS product.- Parameters:
file- A PDS product file.- Throws:
ValidatorExceptionException
-
-