| java.lang.Object gnu.text.SourceMessages
SourceMessages | public class SourceMessages implements SourceLocator(Code) | | A collection of (zero or more) SourceErrors.
Has a "current line number" which clients can use as the default line
number, or clients can explicitly provide a line number.
Does not handle localization of messages.
|
Method Summary | |
public boolean | checkErrors(java.io.PrintWriter out, int max) Checks if an error was seen; if so, prints and clears the messages. | public boolean | checkErrors(java.io.PrintStream out, int max) Checks if an error was seen; if so, prints and clears the messages. | public void | clear() Clear the contained errors and warnings. | public void | clearErrors() Clear the error count (only). | public void | error(SourceError error) Link in an error. | public void | error(char severity, String filename, int line, int column, String message) Record a new error. | public void | error(char severity, SourceLocator location, String message) | public void | error(char severity, String filename, int line, int column, String message, String code) | public void | error(char severity, SourceLocator location, String message, String code) | public void | error(char severity, String message) Record a new error at the current default source file location. | public void | error(char severity, String message, String code) | final public int | getColumnNumber() The default column number to use for a new error. | public int | getErrorCount() Get the number of errors (not counting warnings). | public SourceError | getErrors() | final public String | getFileName() The default filename to use for a new error. | final public int | getLineNumber() The default line number to use for a new error. | public String | getPublicId() | public String | getSystemId() | public boolean | isStableSourceLocation() | public void | printAll(java.io.PrintStream out, int max) Print all the error messages to a PrintStream. | public void | printAll(java.io.PrintWriter out, int max) Print all the error messages to a PrintWriter. | public boolean | seenErrors() Return true iff errors (not warnings) have been seen. | public boolean | seenErrorsOrWarnings() | public void | setColumn(int column) Set the default column number to use for a new error. | public void | setFile(String filename) Set the default filename to use for a new error. | public void | setLine(int line) Set the default line number to use for a new error. | public void | setLine(String filename, int line, int column) Set the default filename, line and column to use for a new error. | final public void | setLocation(SourceLocator locator) Copies the current position of locator. | final public void | setSourceLocator(SourceLocator locator) Links our location to the one give. | public String | toString(int max) Convert this to a String containing the recorded errors. |
current_column | int current_column(Code) | | |
current_line | int current_line(Code) | | |
debugStackTraceOnError | public static boolean debugStackTraceOnError(Code) | | If true, print out stack trace with any error.
|
debugStackTraceOnWarning | public static boolean debugStackTraceOnWarning(Code) | | If true, print out stack trace with any warning.
|
sortMessages | public boolean sortMessages(Code) | | True if we should sort messages by line number.
|
checkErrors | public boolean checkErrors(java.io.PrintWriter out, int max)(Code) | | Checks if an error was seen; if so, prints and clears the messages.
Parameters: out - where to write the error message to Parameters: max - maximum number of messages to print (can be 0) |
checkErrors | public boolean checkErrors(java.io.PrintStream out, int max)(Code) | | Checks if an error was seen; if so, prints and clears the messages.
Parameters: out - where to write the error message to Parameters: max - maximum number of messages to print (can be 0) |
clear | public void clear()(Code) | | Clear the contained errors and warnings.
|
clearErrors | public void clearErrors()(Code) | | Clear the error count (only).
|
error | public void error(char severity, String filename, int line, int column, String message)(Code) | | Record a new error.
Parameters: severity - is the seriousness of the error- one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error) Parameters: filename - the name or URL of the file containing the error Parameters: line - the (1-origin) line number or 0 if unknown Parameters: column - the (1-origin) column number or 0 if unknown Parameters: message - the error message |
error | public void error(char severity, String message)(Code) | | Record a new error at the current default source file location.
Parameters: severity - is the seriousness of the error- one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error) Parameters: message - the error message |
getColumnNumber | final public int getColumnNumber()(Code) | | The default column number to use for a new error.
|
getErrorCount | public int getErrorCount()(Code) | | Get the number of errors (not counting warnings).
|
getFileName | final public String getFileName()(Code) | | The default filename to use for a new error.
|
getLineNumber | final public int getLineNumber()(Code) | | The default line number to use for a new error.
|
isStableSourceLocation | public boolean isStableSourceLocation()(Code) | | |
seenErrors | public boolean seenErrors()(Code) | | Return true iff errors (not warnings) have been seen.
|
seenErrorsOrWarnings | public boolean seenErrorsOrWarnings()(Code) | | |
setColumn | public void setColumn(int column)(Code) | | Set the default column number to use for a new error.
|
setFile | public void setFile(String filename)(Code) | | Set the default filename to use for a new error.
|
setLine | public void setLine(int line)(Code) | | Set the default line number to use for a new error.
|
setLine | public void setLine(String filename, int line, int column)(Code) | | Set the default filename, line and column to use for a new error.
|
setLocation | final public void setLocation(SourceLocator locator)(Code) | | Copies the current position of locator.
|
setSourceLocator | final public void setSourceLocator(SourceLocator locator)(Code) | | Links our location to the one give.
|
toString | public String toString(int max)(Code) | | Convert this to a String containing the recorded errors.
Parameters: max - the maximum number of error error to list a String with one '\n'-terminated line per recorded error |
|
|