Package gov.nasa.pds.validate
Class Validator
java.lang.Object
gov.nasa.pds.validate.Validator
Abstract class to validate a PDS4 product label.
- Author:
- mcayanan
-
Field Summary
FieldsModifier and TypeFieldDescriptionA list of user specified catalogs to use during validation.protected booleanFlag to force validation against a label's schema and schematron.protected LabelValidatorLabelValidator object.protected ReportAn object representation of a report to capture the results of validation.A list of user specified schemas to validate against.protected SchematronTransformerA SchematronTransformer object.protected SchemaValidatorSchema validator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidator(DocumentValidator validator) voidsetCachedEntityResolver(CachedEntityResolver resolver) voidvoidsetCatalogs(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 a PDS product.abstract void
-
Field Details
-
report
An object representation of a report to capture the results of validation. -
schemas
A list of user specified schemas to validate against. -
catalogs
A list of user specified catalogs to use during validation. -
labelValidator
LabelValidator object. -
force
protected boolean forceFlag to force validation against a label's schema and schematron. -
schemaValidator
Schema validator. -
schematronTransformer
A SchematronTransformer object.
-
-
Constructor Details
-
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 Details
-
setSchemas
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
Sets the schematrons to use during validation.- Parameters:
schematrons- A list of schematrons.
-
setCachedEntityResolver
-
setCachedLSResourceResolver
-
setCatalogs
Sets the catalogs to use during validation.- Parameters:
catalogs- A list of catalog files.
-
setForce
public void setForce(boolean value) -
addValidator
-
validate
Validate a PDS product.- Parameters:
file- A PDS product file.- Throws:
ValidatorExceptionException
-
validate
- Throws:
Exception
-