Class ErrorHandler

  • Direct Known Subclasses:
    FunctionErrorHandler, RuleErrorHandler, SrcErrorHandler

    public abstract class ErrorHandler
    extends Object
    This is the super of the error handlers. Each error handler knows how to report a compile error of its type, should it happen. This is needed, as the compiling is done as one hit at the end, and we need to be able to work out what rule/ast element caused the error. An error handler it created for each class task that is queued to be compiled. This doesn't mean an error has occurred, it just means it *may* occur in the future and we need to be able to map it back to the AST element that originally spawned the code to be compiled.
    • Field Detail

      • message

        protected String message
    • Constructor Detail

      • ErrorHandler

        public ErrorHandler()
    • Method Detail

      • isInError

        public boolean isInError()
        This needes to be checked if there is infact an error
      • addError

        public void addError​(org.kie.internal.jci.CompilationProblem err)
      • getError

        public abstract DroolsError getError()
        Returns:
        A DroolsError object populated as appropriate, should the unthinkable happen and this need to be reported.
      • collectCompilerProblems

        protected org.kie.internal.jci.CompilationProblem[] collectCompilerProblems()
        We must use an error of JCI problem objects. If there are no problems, null is returned. These errors are placed in the DroolsError instances. Its not 1 to 1 with reported errors.