01: package persistence.antlr.debug;
02:
03: public class MessageEvent extends Event {
04: private String text;
05: public static int WARNING = 0;
06: public static int ERROR = 1;
07:
08: public MessageEvent(Object source) {
09: super (source);
10: }
11:
12: public MessageEvent(Object source, int type, String text) {
13: super (source);
14: setValues(type, text);
15: }
16:
17: public String getText() {
18: return text;
19: }
20:
21: void setText(String text) {
22: this .text = text;
23: }
24:
25: /** This should NOT be called from anyone other than ParserEventSupport! */
26: void setValues(int type, String text) {
27: super .setValues(type);
28: setText(text);
29: }
30:
31: public String toString() {
32: return "ParserMessageEvent ["
33: + (getType() == WARNING ? "warning," : "error,")
34: + getText() + "]";
35: }
36: }
|