Class ToolErrorReporter

java.lang.Object
org.mozilla.javascript.tools.ToolErrorReporter
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter

public class ToolErrorReporter extends Object implements org.mozilla.javascript.ErrorReporter
Error reporter for tools.

Currently used by both the shell and the compiler.

  • Constructor Details

    • ToolErrorReporter

      public ToolErrorReporter(boolean reportWarnings)
    • ToolErrorReporter

      public ToolErrorReporter(boolean reportWarnings, PrintStream err)
  • Method Details

    • getMessage

      public static String getMessage(String messageId)
      Look up the message corresponding to messageId in the org.mozilla.javascript.tools.shell.resources.Messages property file. For internationalization support.
    • getMessage

      public static String getMessage(String messageId, String argument)
    • getMessage

      public static String getMessage(String messageId, Object arg1, Object arg2)
    • getMessage

      public static String getMessage(String messageId, Object[] args)
    • warning

      public void warning(String message, String sourceName, int line, String lineSource, int lineOffset)
      Specified by:
      warning in interface org.mozilla.javascript.ErrorReporter
    • error

      public void error(String message, String sourceName, int line, String lineSource, int lineOffset)
      Specified by:
      error in interface org.mozilla.javascript.ErrorReporter
    • runtimeError

      public org.mozilla.javascript.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
      Specified by:
      runtimeError in interface org.mozilla.javascript.ErrorReporter
    • hasReportedError

      public boolean hasReportedError()
    • isReportingWarnings

      public boolean isReportingWarnings()
    • setIsReportingWarnings

      public void setIsReportingWarnings(boolean reportWarnings)
    • reportException

      public static void reportException(org.mozilla.javascript.ErrorReporter er, org.mozilla.javascript.RhinoException ex)
    • reportException

      public void reportException(org.mozilla.javascript.RhinoException ex)