gov.nasa.pds.tools.label
Class LabelValidator

java.lang.Object
  extended by gov.nasa.pds.tools.label.LabelValidator

public class LabelValidator
extends Object

This class is responsible for providing utility functions for validating PDS XML Labels.

Author:
pramirez

Field Summary
static String SCHEMA_CHECK
           
static String SCHEMATRON_CHECK
           
 
Constructor Summary
LabelValidator()
           
 
Method Summary
 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 setCatalogs(String[] catalogFiles)
           
 void setConfiguration(String key, Boolean value)
           
 void setModelVersion(String modelVersion)
           
 void setSchema(String[] schemaFiles)
           
 void setSchemaCheck(Boolean value)
           
 void setSchemaCheck(Boolean value, Boolean useLabelSchema)
           
 void setSchematronCheck(Boolean value)
           
 void setSchematronCheck(Boolean value, Boolean useLabelSchematron)
           
 void setSchematronFiles(String[] schematronFiles)
           
 void validate(ExceptionContainer container, File labelFile)
           
 void validate(ExceptionContainer container, URL url)
          Currently this method only validates the label against schema constraints
 void validate(File labelFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_CHECK

public static final String SCHEMA_CHECK
See Also:
Constant Field Values

SCHEMATRON_CHECK

public static final String SCHEMATRON_CHECK
See Also:
Constant Field Values
Constructor Detail

LabelValidator

public LabelValidator()
               throws ParserConfigurationException
Throws:
ParserConfigurationException
Method Detail

setSchema

public void setSchema(String[] schemaFiles)
               throws SAXException
Throws:
SAXException

setSchematronFiles

public void setSchematronFiles(String[] schematronFiles)

setCatalogs

public void setCatalogs(String[] catalogFiles)

validate

public void validate(ExceptionContainer container,
                     File labelFile)
              throws SAXException,
                     IOException,
                     ParserConfigurationException,
                     TransformerException,
                     MissingLabelSchemaException
Throws:
SAXException
IOException
ParserConfigurationException
TransformerException
MissingLabelSchemaException

validate

public void validate(ExceptionContainer container,
                     URL url)
              throws SAXException,
                     IOException,
                     ParserConfigurationException,
                     TransformerException,
                     MissingLabelSchemaException
Currently this method only validates the label against schema constraints

Parameters:
container - to store output messages in
labelFile - to validate
Throws:
SAXException
IOException
ParserConfigurationException
TransformerException
MissingLabelSchemaException

validate

public void validate(File labelFile)
              throws SAXException,
                     IOException,
                     ParserConfigurationException,
                     TransformerException,
                     MissingLabelSchemaException
Throws:
SAXException
IOException
ParserConfigurationException
TransformerException
MissingLabelSchemaException

getSchematrons

public List<String> getSchematrons(NodeList nodeList,
                                   URL url,
                                   ExceptionContainer container)

getModelVersion

public String getModelVersion()

setModelVersion

public void setModelVersion(String modelVersion)
                     throws ValidatorException
Throws:
ValidatorException

performsSchemaValidation

public Boolean performsSchemaValidation()

setSchemaCheck

public void setSchemaCheck(Boolean value)

setSchemaCheck

public void setSchemaCheck(Boolean value,
                           Boolean useLabelSchema)

performsSchematronValidation

public Boolean performsSchematronValidation()

setSchematronCheck

public void setSchematronCheck(Boolean value)

setSchematronCheck

public void setSchematronCheck(Boolean value,
                               Boolean useLabelSchematron)

getConfiguration

public Boolean getConfiguration(String key)

setConfiguration

public void setConfiguration(String key,
                             Boolean value)

addValidator

public void addValidator(ExternalValidator validator)

addValidator

public void addValidator(DocumentValidator validator)

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


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