Package com.google.javascript.rhino
Interface ErrorReporter
-
public interface ErrorReporter
This is interface defines a protocol for the reporting of errors during JavaScript translation or execution.
-
-
Field Summary
Fields Modifier and Type Field Description static ErrorReporter
ALWAYS_THROWS_INSTANCE
static ErrorReporter
NULL_INSTANCE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
error(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Report an error.void
warning(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Report a warning.
-
-
-
Field Detail
-
NULL_INSTANCE
static final ErrorReporter NULL_INSTANCE
-
ALWAYS_THROWS_INSTANCE
static final ErrorReporter ALWAYS_THROWS_INSTANCE
-
-
Method Detail
-
warning
void warning(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
Report a warning. The implementing class may choose to ignore the warning if it desires.- 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
void error(java.lang.String message, java.lang.String sourceName, int line, int lineOffset)
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.- 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
-
-