public class ValidateLauncher extends Object
Constructor and Description |
---|
ValidateLauncher()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
displayHelp()
Displays tool usage.
|
void |
displayVersion()
Displays the current version and disclaimer notice.
|
void |
doValidation(Map<URL,String> checksumManifest)
Performs validation.
|
void |
flushValidators()
Flush ValidatorFactory cache (set to null).
|
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 |
processMain(String[] args)
Wrapper method for the main class.
|
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 |
setAllowUnlabeledFiles(boolean flag) |
void |
setCatalogs(List<String> catalogs)
Set the catalogs.
|
void |
setChecksumManifest(String manifest)
Set the checksum manifest.
|
void |
setContentValidation(boolean flag)
Sets the flag that enables/disables data content validation.
|
void |
setForce(boolean value) |
void |
setManifestBasePath(String path)
Set the base path to look up relative file references in a given checksum
manifest file.
|
void |
setMaxErrors(long value) |
void |
setModelVersion(String version)
Sets the model version to use during validation.
|
void |
setNonRegisteredProducts(boolean nonRegisteredProducts) |
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 |
setSkipProductValidation(boolean flag) |
void |
setSpotCheckData(int value) |
void |
setTargets(List<String> targets)
Set the target.
|
void |
setTraverse(boolean value)
Sets the flag to enable/disable directory recursion.
|
void |
setUpdateRegisteredProducts(boolean updateRegisteredProducts) |
void |
setupReport()
Setup the report.
|
void |
setValidateContext(boolean flag)
Sets the flag that enables/disables context validation.
|
void |
setValidationRule(String value)
Sets the validation rule name to use.
|
public ValidateLauncher() throws TransformerConfigurationException
public org.apache.commons.cli.CommandLine parse(String[] args) throws org.apache.commons.cli.ParseException
args
- The command-line argumentsorg.apache.commons.cli.ParseException
- If an error occurred during parsing.public void query(org.apache.commons.cli.CommandLine line) throws Exception
line
- A CommandLine object containing the flags that were set.Exception
- If an error occurred while processing the command-line
options.public void query(File configuration) throws org.apache.commons.configuration.ConfigurationException
configuration
- A configuration file.org.apache.commons.configuration.ConfigurationException
- If an error occurred while querying the configuration file.public void setTargets(List<String> targets) throws MalformedURLException
targets
- A list of targets.MalformedURLException
public void setChecksumManifest(String manifest) throws MalformedURLException
manifest
- A checksum manifest file.MalformedURLException
public void setManifestBasePath(String path) throws MalformedURLException
path
- A path.MalformedURLException
public void setSchemas(List<String> schemas) throws MalformedURLException
schemas
- A list of schemas.MalformedURLException
public void setSchematrons(List<String> schematrons) throws MalformedURLException
schematrons
- A list of schematrons.MalformedURLException
public void setCatalogs(List<String> catalogs)
catalogs
- A list of catalogs.public void setReport(File report)
report
- A report file.public Report getReport()
public void setReportStyle(String style) throws Exception
style
- 'sum' for a summary report, 'min' for a minimal report, and
'full' for a full reportApplicationException
Exception
public void setTraverse(boolean value)
value
- A boolean value.public void setSeverity(int level)
level
- An interger value.public void setRegExps(List<String> patterns)
patterns
- A list of file patterns.public void setModelVersion(String version)
version
- The model version.public void setForce(boolean value)
public void setValidationRule(String value)
value
- the validation rule namepublic void setContentValidation(boolean flag)
flag
- True or False.public void setSkipProductValidation(boolean flag)
public void setMaxErrors(long value)
public void setSpotCheckData(int value)
public void setAllowUnlabeledFiles(boolean flag)
public void setUpdateRegisteredProducts(boolean updateRegisteredProducts)
public void setNonRegisteredProducts(boolean nonRegisteredProducts)
public void setValidateContext(boolean flag)
flag
- True or False.public void displayHelp()
public void displayVersion() throws IOException
IOException
- If there was an error that occurred while getting the tool
information.public void setupReport() throws IOException
IOException
- If an error occurred while setting up the report.public void doValidation(Map<URL,String> checksumManifest) throws Exception
Exception
public void printReportFooter()
public void processMain(String[] args)
args
- list of command-line arguments.public void flushValidators()
public static void main(String[] args) throws TransformerConfigurationException
args
- A list of command-line arguments.TransformerConfigurationException
Copyright © 2019. All rights reserved.