|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.topcoder.shared.problem.ProblemMessage
This is a utility class for representing messages generate during problem statement parsing and construction. It provides levels of meaning, a message, and, if possible, the location within the problem statement that the message is related to.
| Field Summary | |
static short |
ERROR
Specified that a message's level is 'error'. |
static short |
FATAL_ERROR
Specified that a message's level is 'fatal error' |
static short |
WARNING
Specified that a message's level is 'warning'. |
| Constructor Summary | |
ProblemMessage()
Empty constructor required by custom serialization. |
|
ProblemMessage(int type,
java.lang.String message)
Constructs a message with an unknown location. |
|
ProblemMessage(int type,
java.lang.String message,
int line,
int column)
Constructs a message with a known location. |
|
| Method Summary | |
void |
customReadObject(com.topcoder.shared.netCommon.CSReader reader)
Custom serialization |
void |
customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
Custom serialization |
int |
getColumn()
Returns the column in the problem statement XML to which the message corresponds (if known). |
int |
getLine()
Returns the line in the problem statement XML to which the message corresponds (if known). |
java.lang.String |
getMessage()
Returns the content of the message. |
int |
getType()
The type of a message is one of WARNING, ERROR, or FATAL_ERROR. |
void |
log(Category trace)
Sends the message in an appropriate format to the appropriate log. |
java.lang.String |
toString()
Converts the message and all information associated with it to a human-readable string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static short WARNING
public static short ERROR
public static short FATAL_ERROR
| Constructor Detail |
public ProblemMessage()
public ProblemMessage(int type,
java.lang.String message,
int line,
int column)
type - One of WARNING, ERROR, or FATAL_ERROR.message - The content of the message.line - The number of the line to which the message corresponds. Lines are counted starting at
1.column - The number of the column within the line to which the message corresponds. Columns are
counted starting at 1.
public ProblemMessage(int type,
java.lang.String message)
type - One of WARNING, ERROR, or FATAL_ERROR.message - The content of the message.| Method Detail |
public int getType()
WARNING, ERROR, or FATAL_ERROR.
public int getLine()
0 if the line is unknown, or else a value greater than 0.public int getColumn()
0 if the column is unknown, or else a value greater than 0.public java.lang.String getMessage()
public void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
throws java.io.IOException
customWriteObject in interface com.topcoder.shared.netCommon.CustomSerializablewriter - the writer to write to.
java.io.IOException - if an I/O error has occurred in the stream that backs the writer.
public void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
throws java.io.IOException,
java.io.ObjectStreamException
customReadObject in interface com.topcoder.shared.netCommon.CustomSerializablereader - the reader to read from.
java.io.ObjectStreamException - if the information that is read is inconsistent (stream corrupted
or incompatibility between writers and readers)
java.io.IOException - if an I/O error has occurred in the stream that backs the reader.public void log(Category trace)
trace - A log4j.Category (probably should be a Logger instead).public java.lang.String toString()
Line xx: Column xx: messageLine will only be included if greater than 0. Column will only be included if greater than 0.
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||