|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.DJError
public class DJError
A class to represent source errors and warnings generated by the compiler, JUnit, etc. This class enables DrJava to highlight the error text.
| Field Summary | |
|---|---|
private java.io.File |
_file
|
private boolean |
_isWarning
|
private int |
_lineNumber
zero-based line number. |
private java.lang.String |
_message
|
private boolean |
_noLocation
This boolean is true when the DJError does not have a location (lineNumber is -1). |
private int |
_startColumn
zero-based column number. |
| Constructor Summary | |
|---|---|
DJError(java.io.File file,
int lineNumber,
int startColumn,
java.lang.String message,
boolean isWarning)
Constructor. |
|
DJError(java.io.File file,
java.lang.String message,
boolean isWarning)
Constructor for an DJError with an associated file but no location in the source |
|
DJError(java.lang.String message,
boolean isWarning)
Constructor for CompilerErrors without files. |
|
| Method Summary | |
|---|---|
private int |
compareByPosition(DJError other)
Compares this error's postion with other error's, based first on line number, then by column. |
private int |
compareErrorWarning(DJError other)
Compare otherwise equal errors. |
int |
compareTo(DJError other)
Compares by file, then by line, then by column. |
java.io.File |
file()
Gets the file. |
java.lang.String |
fileName()
Gets the full name of the file. |
java.lang.String |
getFileMessage()
This function returns a message telling the file this error is from appropriate to display to a user, indicating if there is no file associated with this error. |
java.lang.String |
getLineMessage()
This function returns a message telling the line this error is from appropriate to display to a user, indicating if there is no file associated with this error. |
boolean |
hasNoLocation()
This function returns true if and only if the given error has no location |
boolean |
isWarning()
Determines if the error is a warning. |
int |
lineNumber()
Gets the zero-based line number of the error. |
java.lang.String |
message()
Gets the error message. |
void |
setLineNumber(int ln)
Sets the line number. |
int |
startColumn()
Gets the column where the error begins. |
java.lang.String |
toString()
Gets a String representation of the error. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private volatile java.io.File _file
private volatile int _lineNumber
private final int _startColumn
private final java.lang.String _message
private final boolean _isWarning
private volatile boolean _noLocation
| Constructor Detail |
|---|
public DJError(java.io.File file,
int lineNumber,
int startColumn,
java.lang.String message,
boolean isWarning)
file - the file where the error occurredlineNumber - the line number of the errorstartColumn - the starting column of the errormessage - the error message
public DJError(java.io.File file,
java.lang.String message,
boolean isWarning)
public DJError(java.lang.String message,
boolean isWarning)
message - the error message| Method Detail |
|---|
public boolean hasNoLocation()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.io.File file()
public java.lang.String fileName()
public int lineNumber()
public void setLineNumber(int ln)
ln - line numberpublic int startColumn()
public java.lang.String message()
public java.lang.String getFileMessage()
public java.lang.String getLineMessage()
public boolean isWarning()
public int compareTo(DJError other)
compareTo in interface java.lang.Comparable<DJError>private int compareByPosition(DJError other)
private int compareErrorWarning(DJError other)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||