Package com.google.javascript.rhino
Class SimpleErrorReporter
- java.lang.Object
-
- com.google.javascript.rhino.SimpleErrorReporter
-
- All Implemented Interfaces:
ErrorReporter
public class SimpleErrorReporter extends java.lang.Object implements ErrorReporter
A simpleErrorReporter
that collects warnings and errors and makes them accessible viaerrors
andwarnings
.
-
-
Field Summary
-
Fields inherited from interface com.google.javascript.rhino.ErrorReporter
ALWAYS_THROWS_INSTANCE, NULL_INSTANCE
-
-
Constructor Summary
Constructors Constructor Description SimpleErrorReporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
error(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Report an error.static java.lang.String
getMessage0(java.lang.String messageId)
static java.lang.String
getMessage1(java.lang.String messageId, java.lang.Object arg1)
void
warning(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Report a warning.
-
-
-
Method Detail
-
warning
public void warning(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Description copied from interface:ErrorReporter
Report a warning. The implementing class may choose to ignore the warning if it desires.- Specified by:
warning
in interfaceErrorReporter
- Parameters:
message
- a String describing the warningsourceName
- a String describing the JavaScript source where the warning occurred; typically a filename or URLline
- the line number associated with the warninglineOffset
- the offset into lineSource where problem was detected
-
error
public void error(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Description copied from interface:ErrorReporter
Report an error. The implementing class is free to throw an exception if it desires. If execution has not yet begun, the JavaScript engine is free to find additional errors rather than terminating the translation. It will not execute a script that had errors, however.- Specified by:
error
in interfaceErrorReporter
- Parameters:
message
- a String describing the errorsourceName
- a String describing the JavaScript source where the error occurred; typically a filename or URLline
- the line number associated with the errorlineOffset
- the offset into lineSource where problem was detected
-
getMessage0
public static java.lang.String getMessage0(java.lang.String messageId)
-
getMessage1
public static java.lang.String getMessage1(java.lang.String messageId, java.lang.Object arg1)
-
-