java.lang.Object
org.mule.runtime.extension.api.loader.ProblemsReporter

public final class ProblemsReporter extends Object
Collects problems found while validating an ExtensionModel. The purpose is to simply notify all the problems found together.
Since:
1.0
  • Constructor Details

    • ProblemsReporter

      public ProblemsReporter(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
      Creates a new instance
      Parameters:
      extensionModel - the model which is being validated
  • Method Details

    • addError

      public ProblemsReporter addError(Problem problem)
      Adds an error
      Parameters:
      problem - the problem found
      Returns:
      this reporter
    • addWarning

      public ProblemsReporter addWarning(Problem problem)
      Adds a warning
      Parameters:
      problem - the warning found
      Returns:
      this reporter
    • hasErrors

      public boolean hasErrors()
      Returns:
      Whether errors have been reported
    • hasWarnings

      public boolean hasWarnings()
      Returns:
      Whether warnings have been reported
    • getExtensionModel

      public org.mule.runtime.api.meta.model.ExtensionModel getExtensionModel()
      Returns:
      The ExtensionModel that is being/was validated
    • getErrors

      public List<Problem> getErrors()
      Returns:
      immutable list of errors found
    • getWarnings

      public List<Problem> getWarnings()
      Returns:
      immutable list of warnings found
    • getWarningsAsString

      public String getWarningsAsString()
      Returns:
      All the found warnings flattened as a String
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      All found problems flattened as a String. Errors first, warnings later