gov.nasa.pds.validate
Class ValidateLauncher

java.lang.Object
  extended by gov.nasa.pds.validate.ValidateLauncher

public class ValidateLauncher
extends Object

Wrapper class for the Validate Tool. Class handles command-line parsing and querying, in addition to reporting setup.

Author:
mcayanan

Constructor Summary
ValidateLauncher()
          Constructor.
 
Method Summary
 void displayHelp()
          Displays tool usage.
 void displayVersion()
          Displays the current version and disclaimer notice.
 void doValidation()
          Performs validation.
 Report getReport()
          Gets the object representation of the Validation Report.
static void main(String[] args)
          Main class that launches the Validate Tool.
 org.apache.commons.cli.CommandLine parse(String[] args)
          Parse the command-line arguments
 void printReportFooter()
          Print the report footer.
 void query(org.apache.commons.cli.CommandLine line)
          Query the command-line and process the command-line option flags set.
 void query(File configuration)
          Query the configuration file.
 void setCatalogs(List<String> catalogs)
          Set the catalogs.
 void setModelVersion(String version)
          Sets the model version to use during validation.
 void setRegExps(List<String> patterns)
          Sets the list of file patterns to look for if traversing a directory.
 void setReport(File report)
          Sets the report file.
 void setReportStyle(String style)
          Set the output style for the report.
 void setSchemas(List<String> schemas)
          Set the schemas.
 void setSchematrons(List<String> schematrons)
          Set the schematrons.
 void setSeverity(int level)
          Sets the severity level for the report.
 void setTargets(List<String> targets)
          Set the target.
 void setTraverse(boolean value)
          Sets the flag to enable/disable directory recursion.
 void setupReport()
          Setup the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidateLauncher

public ValidateLauncher()
Constructor.

Method Detail

parse

public org.apache.commons.cli.CommandLine parse(String[] args)
                                         throws org.apache.commons.cli.ParseException
Parse the command-line arguments

Parameters:
args - The command-line arguments
Returns:
A class representation of the command-line arguments
Throws:
org.apache.commons.cli.ParseException - If an error occurred during parsing.

query

public void query(org.apache.commons.cli.CommandLine line)
           throws Exception
Query the command-line and process the command-line option flags set.

Parameters:
line - A CommandLine object containing the flags that were set.
Throws:
Exception - If an error occurred while processing the command-line options.

query

public void query(File configuration)
           throws org.apache.commons.configuration.ConfigurationException
Query the configuration file.

Parameters:
configuration - A configuration file.
Throws:
org.apache.commons.configuration.ConfigurationException - If an error occurred while querying the configuration file.

setTargets

public void setTargets(List<String> targets)
                throws MalformedURLException
Set the target.

Parameters:
targets - A list of targets.
Throws:
MalformedURLException

setSchemas

public void setSchemas(List<String> schemas)
Set the schemas.

Parameters:
schemas - A list of schemas.

setSchematrons

public void setSchematrons(List<String> schematrons)
Set the schematrons.

Parameters:
schematrons - A list of schematrons.

setCatalogs

public void setCatalogs(List<String> catalogs)
Set the catalogs.

Parameters:
catalogs - A list of catalogs.

setReport

public void setReport(File report)
Sets the report file.

Parameters:
report - A report file.

getReport

public Report getReport()
Gets the object representation of the Validation Report.

Returns:
The Report object.

setReportStyle

public void setReportStyle(String style)
                    throws Exception
Set the output style for the report.

Parameters:
style - 'sum' for a summary report, 'min' for a minimal report, and 'full' for a full report
Throws:
ApplicationException
Exception

setTraverse

public void setTraverse(boolean value)
Sets the flag to enable/disable directory recursion.

Parameters:
value - A boolean value.

setSeverity

public void setSeverity(int level)
Sets the severity level for the report.

Parameters:
level - An interger value.

setRegExps

public void setRegExps(List<String> patterns)
Sets the list of file patterns to look for if traversing a directory.

Parameters:
patterns - A list of file patterns.

setModelVersion

public void setModelVersion(String version)
Sets the model version to use during validation.

Parameters:
version - The model version.

displayHelp

public void displayHelp()
Displays tool usage.


displayVersion

public void displayVersion()
                    throws IOException
Displays the current version and disclaimer notice.

Throws:
IOException - If there was an error that occurred while getting the tool information.

setupReport

public void setupReport()
                 throws IOException
Setup the report.

Throws:
IOException - If an error occurred while setting up the report.

doValidation

public void doValidation()
                  throws SAXException
Performs validation.

Throws:
SAXException - If one of the schemas is malformed.

printReportFooter

public void printReportFooter()
Print the report footer.


main

public static void main(String[] args)
Main class that launches the Validate Tool.

Parameters:
args - A list of command-line arguments.


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