Package org.codelibs.maven.yuicompressor
Class ErrorReporter4Mojo
java.lang.Object
org.codelibs.maven.yuicompressor.ErrorReporter4Mojo
- All Implemented Interfaces:
org.mozilla.javascript.ErrorReporter
Error reporter implementation for Maven Mojo that integrates with Maven logging
and BuildContext for IDE incremental build support.
-
Constructor Summary
ConstructorsConstructorDescriptionErrorReporter4Mojo(org.apache.maven.plugin.logging.Log log, boolean jswarn, org.sonatype.plexus.build.incremental.BuildContext buildContext) Creates a new error reporter. -
Method Summary
Modifier and TypeMethodDescriptionvoidintReturns the number of errors reported.intReturns the number of warnings reported.org.mozilla.javascript.EvaluatorExceptionruntimeError(String message, String sourceName, int line, String lineSource, int lineOffset) voidsetDefaultFileName(String filename) Sets the default filename to use when source name is not provided.voidSets the current source file being processed.void
-
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 loggerjswarn- whether to accept and report warningsbuildContext- build context for IDE integration
-
-
Method Details
-
setDefaultFileName
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
Sets the current source file being processed.- Parameters:
file- the source file
-
error
- Specified by:
errorin interfaceorg.mozilla.javascript.ErrorReporter
-
runtimeError
public org.mozilla.javascript.EvaluatorException runtimeError(String message, String sourceName, int line, String lineSource, int lineOffset) - Specified by:
runtimeErrorin interfaceorg.mozilla.javascript.ErrorReporter
-
warning
- Specified by:
warningin interfaceorg.mozilla.javascript.ErrorReporter
-