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