public class ErrorReporterImpl extends Object implements ErrorReporter
ErrorReporter implementation.ErrorReporter.Checkpoint| Modifier and Type | Field and Description |
|---|---|
protected List<SoySyntaxException> |
errors |
| Constructor and Description |
|---|
ErrorReporterImpl() |
| Modifier and Type | Method and Description |
|---|---|
ErrorReporter.Checkpoint |
checkpoint()
Returns an opaque token (the checkpoint) that callers can later pass back into
ErrorReporter.errorsSince(com.google.template.soy.soyparse.ErrorReporter.Checkpoint) to see if any errors have occurred in the interim. |
boolean |
errorsSince(ErrorReporter.Checkpoint checkpoint)
Returns true iff errors have occurred since
checkpoint was obtained
from ErrorReporter.checkpoint(). |
com.google.common.collect.ImmutableCollection<? extends SoySyntaxException> |
getErrors()
Returns the full list of errors reported to this error reporter.
|
void |
report(SourceLocation sourceLocation,
SoyError error,
String... args)
Reports the given
error, formatted according to args and associated with
the given sourceLocation. |
protected final List<SoySyntaxException> errors
public void report(SourceLocation sourceLocation, SoyError error, String... args)
ErrorReportererror, formatted according to args and associated with
the given sourceLocation.report in interface ErrorReporterpublic ErrorReporter.Checkpoint checkpoint()
ErrorReporterErrorReporter.errorsSince(com.google.template.soy.soyparse.ErrorReporter.Checkpoint) to see if any errors have occurred in the interim.checkpoint in interface ErrorReporterpublic boolean errorsSince(ErrorReporter.Checkpoint checkpoint)
ErrorReportercheckpoint was obtained
from ErrorReporter.checkpoint().
Useful for callers whose outputs are dependent on whether some code path resulted in new errors (for example, returning an error node if parsing encountered errors).
errorsSince in interface ErrorReporterpublic com.google.common.collect.ImmutableCollection<? extends SoySyntaxException> getErrors()