Class ProblemContainer

java.lang.Object
gov.nasa.pds.tools.validate.ProblemContainer
All Implemented Interfaces:
ProblemHandler, ProblemListener

public class ProblemContainer
extends Object
implements ProblemListener
Implements a problem listener that accumulates problems in a list.
  • Constructor Details

    • ProblemContainer

      public ProblemContainer()
  • Method Details

    • addProblem

      public void addProblem​(ValidationProblem problem)
      Description copied from interface: ProblemHandler
      Indicates another problem during the validation.
      Specified by:
      addProblem in interface ProblemHandler
      Parameters:
      problem - the validation problem encountered
    • addLocation

      public void addLocation​(String location)
      Description copied from interface: ProblemListener
      Adds a location to the listener.
      Specified by:
      addLocation in interface ProblemListener
      Parameters:
      location - the location of the label being validated.
    • getProblems

      public List<ValidationProblem> getProblems()
      Gets the problems encountered.
      Returns:
      the problems
    • getProblemCount

      public int getProblemCount()
      Gets the number of problems reported.
      Returns:
      the count of problems
    • clear

      public void clear()
      Clears all problems.
    • getErrorCount

      public int getErrorCount()
      Description copied from interface: ProblemListener
      Gets the number of error problems encountered.
      Specified by:
      getErrorCount in interface ProblemListener
      Returns:
      the error count
    • hasError

      public Boolean hasError()
    • hasFatal

      public Boolean hasFatal()
    • getWarningCount

      public int getWarningCount()
      Description copied from interface: ProblemListener
      Gets the number of warning problems encountered.
      Specified by:
      getWarningCount in interface ProblemListener
      Returns:
      the warning count
    • hasWarning

      public Boolean hasWarning()
    • getInfoCount

      public int getInfoCount()
      Description copied from interface: ProblemListener
      Gets the number of informational problems encountered.
      Specified by:
      getInfoCount in interface ProblemListener
      Returns:
      the info count
    • hasInfo

      public Boolean hasInfo()
    • 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 interface ProblemListener
      Parameters:
      location - the target location
      includeChildren - true, if problems for child locations should be included
      Returns:
      a collection of problems
    • hasProblems

      public boolean hasProblems​(String location, boolean includeChildren)
      Description copied from interface: ProblemListener
      Tests whether a target has had problems reported.
      Specified by:
      hasProblems in interface ProblemListener
      Parameters:
      location - the target location
      includeChildren - true, if problems for child locations should be included
      Returns:
      true, if problems have been reported
    • getSeverity

      public ExceptionType getSeverity​(String location, boolean includeChildren)
      Description copied from interface: ProblemListener
      Gets the maximum severity of problems related to a location.
      Specified by:
      getSeverity in interface ProblemListener
      Parameters:
      location - the target location
      includeChildren - true, if problems in children of the target should be included
      Returns:
      the maximum problem severity