Class JavaScriptErrorReporter

java.lang.Object
com.samaxes.maven.minify.common.JavaScriptErrorReporter
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter

public class JavaScriptErrorReporter extends Object implements org.mozilla.javascript.ErrorReporter
A Rhino compatible error reporter.
  • Constructor Summary

    Constructors
    Constructor
    Description
    JavaScriptErrorReporter(org.apache.maven.plugin.logging.Log log, String filename)
    Error reporter constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(String message, String sourceName, int line, String lineSource, int lineOffset)
    Reports an error.
    org.mozilla.javascript.EvaluatorException
    runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
    Creates an EvaluatorException that may be thrown. runtimeErrors, unlike errors, will always terminate the current script.
    void
    warning(String message, String sourceName, int line, String lineSource, int lineOffset)
    Reports a warning.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JavaScriptErrorReporter

      public JavaScriptErrorReporter(org.apache.maven.plugin.logging.Log log, String filename)
      Error reporter constructor.
      Parameters:
      log - Maven plugin log
      filename - JavaScript source file name
  • Method Details

    • warning

      public void warning(String message, String sourceName, int line, String lineSource, int lineOffset)
      Reports a warning.
      Specified by:
      warning in interface org.mozilla.javascript.ErrorReporter
      Parameters:
      message - a String describing the warning
      sourceName - a String describing the JavaScript source where the warning occurred; typically a file name or URL
      line - the line number associated with the warning
      lineSource - the text of the line (may be null)
      lineOffset - the offset into lineSource where problem was detected
    • error

      public void error(String message, String sourceName, int line, String lineSource, int lineOffset)
      Reports an error. If execution has not yet begun, the JavaScript engine is free to find additional errors rather than terminating the translation. However, it will not execute a script that had errors.
      Specified by:
      error in interface org.mozilla.javascript.ErrorReporter
      Parameters:
      message - a String describing the warning
      sourceName - a String describing the JavaScript source where the warning occurred; typically a file name or URL
      line - the line number associated with the warning
      lineSource - the text of the line (may be null)
      lineOffset - the offset into lineSource where problem was detected
    • runtimeError

      public org.mozilla.javascript.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
      Creates an EvaluatorException that may be thrown. runtimeErrors, unlike errors, will always terminate the current script.
      Specified by:
      runtimeError in interface org.mozilla.javascript.ErrorReporter
      Parameters:
      message - a String describing the warning
      sourceName - a String describing the JavaScript source where the warning occurred; typically a file name or URL
      line - the line number associated with the warning
      lineSource - the text of the line (may be null)
      lineOffset - the offset into lineSource where problem was detected