gov.nasa.pds.validate
Class Validator

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

public abstract class Validator
extends Object

Abstract class to validate a PDS4 product label.

Author:
mcayanan

Field Summary
protected  String modelVersion
          The model version to validate against.
protected  Report report
          An object representation of a report to capture the results of validation.
protected  Schema schema
          An object representataion of a schema to validate against.
 
Constructor Summary
Validator(String modelVersion, Report report)
          Constructor.
 
Method Summary
 void setSchema(List<File> schemaFiles)
          Sets the schemas to use during validation.
 void setSchema(Schema schema)
          Set the schema.
abstract  void validate(File file)
          Validate a PDS product.
 
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.


schema

protected Schema schema
An object representataion of a schema to validate against.


modelVersion

protected String modelVersion
The model version to validate against.

Constructor Detail

Validator

public Validator(String modelVersion,
                 Report report)
Constructor.

Parameters:
modelVersion - The model version to use for validation.
report - A Report object to output the results of the validation run.
Method Detail

setSchema

public void setSchema(List<File> 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 - If a schema is malformed.

setSchema

public void setSchema(Schema schema)
Set the schema.

Parameters:
schema - An object representation of a schema.

validate

public abstract void validate(File file)
                       throws SAXException,
                              IOException,
                              ParserConfigurationException,
                              XPathExpressionException,
                              InventoryReaderException
Validate a PDS product.

Parameters:
file - A PDS product file.
Throws:
SAXException
IOException
ParserConfigurationException
XPathExpressionException
InventoryReaderException


Copyright © 2010-2011 Planetary Data System. All Rights Reserved.