Package gov.nasa.pds.tools.validate.task
Class ValidationTask
- java.lang.Object
-
- gov.nasa.pds.tools.validate.task.ValidationTask
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gov.nasa.pds.tools.validate.task.Task
Task.Status
-
-
Constructor Summary
Constructors Constructor Description ValidationTask(ProblemListener problemListener, RuleContext context, TargetRegistrar targetRegistrar)
Creates a new instance of the validation task.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(TaskAdvisor advisor)
Executes the task with a given advisor to detect cancel requests.List<TargetWithErrors>
getAllTargets()
int
getErrorCount()
Gets the count of errors encountered.int
getErrorLimit()
Gets the limit on the number of errors found.int
getInfoCount()
Gets the count of informational events encountered.String
getLocation()
Gets the location of the target to validate.ProblemListener
getProblemListener()
Gets the problem listener for getting problems found.TargetRegistrar
getRegistrar()
Gets the registrar for getting target information.String
getValidationType()
Gets the type of validation.int
getWarningCount()
Gets the count of warnings encountered.void
setErrorLimit(int limit)
Sets the limit on the number of errors encountered before the validation will terminate.void
setLocation(String location)
Sets the location to validate.void
setRule(ValidationRule rule)
Sets the validation rule to use.void
setRuleManager(ValidationRuleManager ruleManager)
Sets the validation rule manager to use for finding validation rules.
-
-
-
Constructor Detail
-
ValidationTask
public ValidationTask(ProblemListener problemListener, RuleContext context, TargetRegistrar targetRegistrar)
Creates a new instance of the validation task.- Parameters:
listener
- the problem listener for the task
-
-
Method Detail
-
getLocation
public String getLocation()
Gets the location of the target to validate.- Returns:
- the target location
-
setLocation
public void setLocation(String location)
Sets the location to validate.- Parameters:
location
- the location to validate
-
getErrorLimit
public int getErrorLimit()
Gets the limit on the number of errors found.- Returns:
- the error limit
-
setErrorLimit
public void setErrorLimit(int limit)
Sets the limit on the number of errors encountered before the validation will terminate.- Parameters:
limit
- the error limit
-
getValidationType
public String getValidationType()
Gets the type of validation.- Returns:
- the validation type
-
setRule
public void setRule(ValidationRule rule)
Sets the validation rule to use.- Parameters:
rule
- the validation rule
-
execute
public void execute(TaskAdvisor advisor)
Description copied from interface:Task
Executes the task with a given advisor to detect cancel requests.
-
getErrorCount
public int getErrorCount()
Gets the count of errors encountered.- Returns:
- the error count
-
getWarningCount
public int getWarningCount()
Gets the count of warnings encountered.- Returns:
- the warning count
-
getInfoCount
public int getInfoCount()
Gets the count of informational events encountered.- Returns:
- the count of info messages
-
setRuleManager
public void setRuleManager(ValidationRuleManager ruleManager)
Sets the validation rule manager to use for finding validation rules.- Parameters:
ruleManager
- the rule manager to use
-
getRegistrar
public TargetRegistrar getRegistrar()
Gets the registrar for getting target information.- Returns:
- the target registrar
-
getProblemListener
public ProblemListener getProblemListener()
Gets the problem listener for getting problems found.- Returns:
- the problem listener
-
getAllTargets
public List<TargetWithErrors> getAllTargets()
-
-