Package gov.nasa.pds.tools.validate
Class ListenerExceptionPropagator
java.lang.Object
gov.nasa.pds.tools.validate.ListenerExceptionPropagator
- All Implemented Interfaces:
ProblemHandler
,ProblemListener
public class ListenerExceptionPropagator extends Object implements ProblemListener
Listener class intended to propagate the problems to a handler for
further processing.
- Author:
- mrose, mcayanan
-
Constructor Summary
Constructors Constructor Description ListenerExceptionPropagator(ValidateProblemHandler handler)
-
Method Summary
Modifier and Type Method Description void
addLocation(String location)
Adds a location to the listener.void
addProblem(ValidationProblem problem)
Indicates another problem during the validation.int
getErrorCount()
Gets the number of error problems encountered.int
getInfoCount()
Gets the number of informational problems encountered.Collection<ValidationProblem>
getProblemsForLocation(String location, boolean includeChildren)
Gets a collection of problems for a given location.ExceptionType
getSeverity(String location, boolean includeChildren)
Gets the maximum severity of problems related to a location.int
getWarningCount()
Gets the number of warning problems encountered.boolean
hasProblems(String location, boolean includeChildren)
Tests whether a target has had problems reported.void
printHeader(String title)
void
record(String location)
-
Constructor Details
-
ListenerExceptionPropagator
-
-
Method Details
-
addProblem
Description copied from interface:ProblemHandler
Indicates another problem during the validation.- Specified by:
addProblem
in interfaceProblemHandler
- Parameters:
problem
- the validation problem encountered
-
getErrorCount
public int getErrorCount()Description copied from interface:ProblemListener
Gets the number of error problems encountered.- Specified by:
getErrorCount
in interfaceProblemListener
- Returns:
- the error count
-
getWarningCount
public int getWarningCount()Description copied from interface:ProblemListener
Gets the number of warning problems encountered.- Specified by:
getWarningCount
in interfaceProblemListener
- Returns:
- the warning count
-
getInfoCount
public int getInfoCount()Description copied from interface:ProblemListener
Gets the number of informational problems encountered.- Specified by:
getInfoCount
in interfaceProblemListener
- Returns:
- the info count
-
hasProblems
Description copied from interface:ProblemListener
Tests whether a target has had problems reported.- Specified by:
hasProblems
in interfaceProblemListener
- Parameters:
location
- the target locationincludeChildren
- true, if problems for child locations should be included- Returns:
- true, if problems have been reported
-
getSeverity
Description copied from interface:ProblemListener
Gets the maximum severity of problems related to a location.- Specified by:
getSeverity
in interfaceProblemListener
- Parameters:
location
- the target locationincludeChildren
- true, if problems in children of the target should be included- Returns:
- the maximum problem severity
-
getProblemsForLocation
public Collection<ValidationProblem> getProblemsForLocation(String location, boolean includeChildren)Description copied from interface:ProblemListener
Gets a collection of problems for a given location.- Specified by:
getProblemsForLocation
in interfaceProblemListener
- Parameters:
location
- the target locationincludeChildren
- true, if problems for child locations should be included- Returns:
- a collection of problems
-
addLocation
Description copied from interface:ProblemListener
Adds a location to the listener.- Specified by:
addLocation
in interfaceProblemListener
- Parameters:
location
- the location of the label being validated.
-
record
-
printHeader
-