Class ErrorHandler

  • Direct Known Subclasses:
    FunctionErrorHandler, RuleErrorHandler, SrcErrorHandler

    public abstract class ErrorHandler
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String message  
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorHandler()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addError​(org.kie.internal.jci.CompilationProblem err)  
      protected org.kie.internal.jci.CompilationProblem[] collectCompilerProblems()
      We must use an error of JCI problem objects.
      abstract org.drools.drl.parser.DroolsError getError()  
      boolean isInError()
      This needes to be checked if there is infact an error
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • message

        protected java.lang.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 org.drools.drl.parser.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.