gov.nasa.pds.validate
Class Validator

java.lang.Object
  extended by gov.nasa.pds.validate.Validator
Direct Known Subclasses:
FileValidator

public abstract class Validator
extends Object

Abstract class to validate a PDS4 product label.

Author:
mcayanan

Field Summary
protected  List<String> catalogs
          A list of user specified catalogs to use during validation.
protected  gov.nasa.pds.tools.label.LabelValidator labelValidator
           
protected  Report report
          An object representation of a report to capture the results of validation.
protected  List<String> schemas
          A list of user specified schemas to validate against.
protected  List<String> schematrons
          A list of user specified schematrons to validate against.
 
Constructor Summary
Validator(String modelVersion, Report report)
          Constructor.
 
Method Summary
 void addValidator(gov.nasa.pds.tools.label.validate.DocumentValidator validator)
           
 void setCatalogs(List<String> catalogs)
          Sets the catalogs to use during validation.
 void setForce(boolean value)
           
 void setSchemas(List<String> schemaFiles)
          Sets the schemas to use during validation.
 void setSchematrons(List<String> schematronFiles)
          Sets the schematrons to use during validation.
abstract  void validate(File file)
          Validate a PDS product.
abstract  void validate(URL url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

report

protected Report report
An object representation of a report to capture the results of validation.


schemas

protected List<String> schemas
A list of user specified schemas to validate against.


schematrons

protected List<String> schematrons
A list of user specified schematrons to validate against.


catalogs

protected List<String> catalogs
A list of user specified catalogs to use during validation.


labelValidator

protected gov.nasa.pds.tools.label.LabelValidator labelValidator
Constructor Detail

Validator

public Validator(String modelVersion,
                 Report report)
          throws ParserConfigurationException,
                 gov.nasa.pds.tools.label.ValidatorException
Constructor.

Parameters:
modelVersion - The model version to use for validation.
report - A Report object to output the results of the validation run.
Throws:
ParserConfigurationException
gov.nasa.pds.tools.label.ValidatorException
Method Detail

setSchemas

public void setSchemas(List<String> 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> schematronFiles)
Sets the schematrons to use during validation.

Parameters:
schematronFiles - A list of schematron files.

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(gov.nasa.pds.tools.label.validate.DocumentValidator validator)

validate

public abstract void validate(File file)
                       throws Exception
Validate a PDS product.

Parameters:
file - A PDS product file.
Throws:
gov.nasa.pds.tools.label.ValidatorException
Exception

validate

public abstract void validate(URL url)
                       throws Exception
Throws:
Exception


Copyright © 2010–2014 Planetary Data System. All rights reserved.