Class ErrorManager

java.lang.Object
com.oracle.js.parser.ErrorManager
Direct Known Subclasses:
ErrorManager.StringBuilderErrorManager, ErrorManager.ThrowErrorManager

public abstract class ErrorManager extends Object
Handles JavaScript error reporting.
  • Constructor Details

    • ErrorManager

      protected ErrorManager()
      Constructor
  • Method Details

    • format

      public static String format(String message, Source source, int line, int column, long token)
      Format an error message to include source and line information.
      Parameters:
      message - Error message string.
      source - Source file information.
      line - Source line number.
      column - Source column number.
      token - Offending token descriptor.
      Returns:
      formatted string
    • message

      protected void message(String message)
      Report an error or warning message.
      Parameters:
      message - Error message string.
    • error

      public void error(ParserException e)
      Report an error using information provided by the ParserException
      Parameters:
      e - ParserException object
    • error

      public void error(String message)
      Report an error message provided
      Parameters:
      message - Error message string.
    • warning

      public void warning(ParserException e)
      Report a warning using information provided by the ParserException
      Parameters:
      e - ParserException object
    • warning

      public void warning(String message)
      Report a warning message provided
      Parameters:
      message - Error message string.
    • hasErrors

      public boolean hasErrors()
      Test to see if errors have occurred.
      Returns:
      True if errors.
    • getLimit

      public int getLimit()
      Get the message limit
      Returns:
      max number of messages
    • setLimit

      public void setLimit(int limit)
      Set the message limit
      Parameters:
      limit - max number of messages
    • isWarningsAsErrors

      public boolean isWarningsAsErrors()
      Check whether warnings should be treated like errors
      Returns:
      true if warnings should be treated like errors
    • setWarningsAsErrors

      public void setWarningsAsErrors(boolean warningsAsErrors)
      Set warnings to be treated as errors
      Parameters:
      warningsAsErrors - true if warnings should be treated as errors, false otherwise
    • getNumberOfErrors

      public int getNumberOfErrors()
      Get the number of errors
      Returns:
      number of errors
    • getNumberOfWarnings

      public int getNumberOfWarnings()
      Get number of warnings
      Returns:
      number of warnings
    • getParserException

      public ParserException getParserException()