Class ErrorReporter4Mojo

java.lang.Object
org.codelibs.maven.yuicompressor.ErrorReporter4Mojo
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter

public class ErrorReporter4Mojo extends Object implements org.mozilla.javascript.ErrorReporter
Error reporter implementation for Maven Mojo that integrates with Maven logging and BuildContext for IDE incremental build support.
  • Constructor Details

    • ErrorReporter4Mojo

      public ErrorReporter4Mojo(org.apache.maven.plugin.logging.Log log, boolean jswarn, org.sonatype.plexus.build.incremental.BuildContext buildContext)
      Creates a new error reporter.
      Parameters:
      log - Maven logger
      jswarn - whether to accept and report warnings
      buildContext - build context for IDE integration
  • Method Details

    • setDefaultFileName

      public void setDefaultFileName(String filename)
      Sets the default filename to use when source name is not provided.
      Parameters:
      filename - the default filename
    • getErrorCnt

      public int getErrorCnt()
      Returns the number of errors reported.
      Returns:
      error count
    • getWarningCnt

      public int getWarningCnt()
      Returns the number of warnings reported.
      Returns:
      warning count
    • setFile

      public void setFile(File file)
      Sets the current source file being processed.
      Parameters:
      file - the source file
    • 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
    • warning

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