KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > debug > MessageEvent


1 package antlr.debug;
2
3 public class MessageEvent extends Event {
4     private String JavaDoc text;
5     public static int WARNING = 0;
6     public static int ERROR = 1;
7
8
9     public MessageEvent(Object JavaDoc source) {
10         super(source);
11     }
12     public MessageEvent(Object JavaDoc source, int type, String JavaDoc text) {
13         super(source);
14         setValues(type,text);
15     }
16     public String JavaDoc getText() {
17         return text;
18     }
19     void setText(String JavaDoc text) {
20         this.text = text;
21     }
22     /** This should NOT be called from anyone other than ParserEventSupport! */
23     void setValues(int type, String JavaDoc text) {
24         super.setValues(type);
25         setText(text);
26     }
27     public String JavaDoc toString() {
28         return "ParserMessageEvent [" +
29                (getType()==WARNING?"warning,":"error,") +
30                getText() + "]";
31     }
32 }
Popular Tags