public abstract class ErrorManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ErrorManager.StringBuilderErrorManager
ErrorManager that reports to a StringBuilder. |
static class |
ErrorManager.ThrowErrorManager
ThrowErrorManager that throws ParserException upon error conditions.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ErrorManager()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
error(ParserException e)
Report an error using information provided by the ParserException
|
void |
error(String message)
Report an error message provided
|
static String |
format(String message,
Source source,
int line,
int column,
long token)
Format an error message to include source and line information.
|
int |
getLimit()
Get the message limit
|
int |
getNumberOfErrors()
Get the number of errors
|
int |
getNumberOfWarnings()
Get number of warnings
|
ParserException |
getParserException() |
boolean |
hasErrors()
Test to see if errors have occurred.
|
boolean |
isWarningsAsErrors()
Check whether warnings should be treated like errors
|
protected void |
message(String message)
Report an error or warning message.
|
void |
setLimit(int limit)
Set the message limit
|
void |
setWarningsAsErrors(boolean warningsAsErrors)
Set warnings to be treated as errors
|
void |
warning(ParserException e)
Report a warning using information provided by the ParserException
|
void |
warning(String message)
Report a warning message provided
|
public static String format(String message, Source source, int line, int column, long token)
message - Error message string.source - Source file information.line - Source line number.column - Source column number.token - Offending token descriptor.protected void message(String message)
message - Error message string.public void error(ParserException e)
e - ParserException objectpublic void error(String message)
message - Error message string.public void warning(ParserException e)
e - ParserException objectpublic void warning(String message)
message - Error message string.public boolean hasErrors()
public int getLimit()
public void setLimit(int limit)
limit - max number of messagespublic boolean isWarningsAsErrors()
public void setWarningsAsErrors(boolean warningsAsErrors)
warningsAsErrors - true if warnings should be treated as errors, false otherwisepublic int getNumberOfErrors()
public int getNumberOfWarnings()
public ParserException getParserException()