|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Complaint
is a general name for a semantic/syntactic
warnings and errors.
Field Summary | |
static int |
LEXICAL_ERROR
Type constant for a lexical error. |
static int |
SEMANTIC_ERROR
Type constant for a semantic error. |
static int |
SEMANTIC_WARNING
Type constant for a semantic warning. |
static int |
SYNTACTIC_ERROR
Type constant for a syntactic error. |
static int |
UNSPECIFIED_ERROR
Type constant for a nonspecific error. |
Method Summary | |
int |
getLineNumber()
Returns the line number of the error or -1 if it
is not known. |
String |
getMessage()
Returns a message describing this complaint. |
String |
getSource()
Returns the name of the source file/URI/whatever or null if it is not known. |
int |
getType()
Returns the type of this Complaint as one of the
constants in this interface. |
void |
printMessage()
Prints a trace of the Complaint to
System.out . |
void |
printMessage(PrintStream out)
Identical to printMessage() with the exception
that output is written to the given PrintStream
rather than System.out . |
Field Detail |
public static final int SEMANTIC_ERROR
public static final int SEMANTIC_WARNING
public static final int LEXICAL_ERROR
public static final int SYNTACTIC_ERROR
public static final int UNSPECIFIED_ERROR
Method Detail |
public int getType()
Complaint
as one of the
constants in this interface.public String getSource()
null
if it is not known.public int getLineNumber()
-1
if it
is not known. The first line is 1
, there is no
line zero.public String getMessage()
public void printMessage()
Complaint
to
System.out
. The printMessage()
and
getMessage()
operations are different in that
printMessage()
will synthesize a formatted output
that may include all the other data (source URI, line number,
etc...) whereas getMessage()
will only return the
message string. The contract is analogous to the
printStackTrace()
and getMessage()
methods in the Throwable
heirarchy.public void printMessage(PrintStream out)
printMessage()
with the exception
that output is written to the given PrintStream
rather than System.out
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |