|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.text.SourceMessages
public class SourceMessages
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.
Field Summary | |
---|---|
boolean |
sortMessages
True if we should sort messages by line number. |
Constructor Summary | |
---|---|
SourceMessages()
|
Method Summary | |
---|---|
boolean |
checkErrors(java.io.PrintStream out,
int max)
Checks if an error was seen; if so, prints and clears the messages. |
boolean |
checkErrors(java.io.PrintWriter out,
int max)
Checks if an error was seen; if so, prints and clears the messages. |
void |
clear()
Clear the contained errors and warnings. |
void |
clearErrors()
Clear the error count (only). |
void |
error(char severity,
java.lang.String message)
Record a new error at the current default source file location. |
void |
error(char severity,
java.lang.String filename,
int line,
int column,
java.lang.String message)
Record a new error. |
void |
error(SourceError error)
Link in an error. |
int |
getColumn()
The default column number to use for a new error. |
int |
getErrorCount()
Get the number of errors (not counting warnings). |
SourceError |
getErrors()
|
java.lang.String |
getFile()
The default filename to use for a new error. |
int |
getLine()
The default line number to use for a new error. |
void |
printAll(java.io.PrintStream out,
int max)
Print all the error messages to a PrintStream. |
void |
printAll(java.io.PrintWriter out,
int max)
Print all the error messages to a PrintWriter. |
boolean |
seenErrors()
Return true iff errors (not warnings) have been seen. |
void |
setColumn(int column)
Set the default column number to use for a new error. |
void |
setFile(java.lang.String filename)
Set the default filename to use for a new error. |
void |
setLine(int line)
Set the default line number to use for a new error. |
void |
setLine(java.lang.String filename,
int line,
int column)
Set the default filename, line and column to use for a new error. |
java.lang.String |
toString(int max)
Convert this to a String containing the recorded errors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean sortMessages
Constructor Detail |
---|
public SourceMessages()
Method Detail |
---|
public SourceError getErrors()
public boolean seenErrors()
public int getErrorCount()
public void clearErrors()
public void clear()
public void error(SourceError error)
public void error(char severity, java.lang.String filename, int line, int column, java.lang.String message)
severity
- is the seriousness of the error
- one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error)filename
- the name or URL of the file containing the errorline
- the (1-origin) line number or 0 if unknowncolumn
- the (1-origin) column number or 0 if unknownmessage
- the error messagepublic void error(char severity, java.lang.String message)
severity
- is the seriousness of the error
- one of 'w' (for warning), 'e' (for error), or 'f' (for fatal error)message
- the error messagepublic void printAll(java.io.PrintStream out, int max)
public void printAll(java.io.PrintWriter out, int max)
public java.lang.String toString(int max)
max
- the maximum number of error error to list
public boolean checkErrors(java.io.PrintWriter out, int max)
out
- where to write the error message tomax
- maximum number of messages to print (can be 0)public boolean checkErrors(java.io.PrintStream out, int max)
out
- where to write the error message tomax
- maximum number of messages to print (can be 0)public final java.lang.String getFile()
public final int getLine()
public final int getColumn()
public void setFile(java.lang.String filename)
public void setLine(int line)
public void setColumn(int column)
public void setLine(java.lang.String filename, int line, int column)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |