com.github.bringking.maven.less
Class MojoErrorReporter

java.lang.Object
  extended by com.github.bringking.maven.less.MojoErrorReporter
All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter

public class MojoErrorReporter
extends Object
implements org.mozilla.javascript.ErrorReporter

JS execution error reporter for maven plugins.


Constructor Summary
MojoErrorReporter(org.apache.maven.plugin.logging.Log log, boolean acceptWarnings)
          Create a new error reporter.
 
Method Summary
 void error(String message, String sourceName, int line, String lineSource, int lineOffset)
          Report an error.
 int getErrorCnt()
           
 int getWarningCnt()
           
 org.mozilla.javascript.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset)
          Report an runtime error.
 void setDefaultFileName(String filename)
          Set the default filename to report errors against.
 void warning(String message, String sourceName, int line, String lineSource, int lineOffset)
          Report an warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MojoErrorReporter

public MojoErrorReporter(org.apache.maven.plugin.logging.Log log,
                         boolean acceptWarnings)
Create a new error reporter.

Parameters:
log - the log for the executing mojo
acceptWarnings - whether or not to report warnings
Method Detail

setDefaultFileName

public void setDefaultFileName(String filename)
Set the default filename to report errors against.

Parameters:
filename - the filename to use

error

public void error(String message,
                  String sourceName,
                  int line,
                  String lineSource,
                  int lineOffset)
Report an error.

Specified by:
error in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - the error message
sourceName - the name of the source the error occurred in
line - the line number the error occurred on
lineSource - the contents of the line the error occurred on
lineOffset - the position in the line where the error occurred

runtimeError

public org.mozilla.javascript.EvaluatorException runtimeError(String message,
                                                              String sourceName,
                                                              int line,
                                                              String lineSource,
                                                              int lineOffset)
Report an runtime error.

Specified by:
runtimeError in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - the runtime error message
sourceName - the name of the source the runtime error occurred in
line - the line number the runtime error occurred on
lineSource - the contents of the line the runtime error occurred on
lineOffset - the position in the line where the runtime error occurred
Returns:
an EvaluatorException in theory, in practice just throws one

warning

public void warning(String message,
                    String sourceName,
                    int line,
                    String lineSource,
                    int lineOffset)
Report an warning.

Specified by:
warning in interface org.mozilla.javascript.ErrorReporter
Parameters:
message - the warning message
sourceName - the name of the source the warning occurred in
line - the line number the warning occurred on
lineSource - the contents of the line the warning occurred on
lineOffset - the position in the line where the warning occurred

getErrorCnt

public int getErrorCnt()

getWarningCnt

public int getWarningCnt()


Copyright © 2014. All Rights Reserved.