1 23 24 package org.dbforms.config; 25 26 import org.apache.commons.logging.Log; 27 import org.apache.commons.logging.LogFactory; 28 29 import java.util.Hashtable ; 30 31 32 33 38 public class Error { 39 private static Log logCat = LogFactory.getLog(Error .class.getName()); 40 private Hashtable messages; 41 42 private String id; private String type; 47 50 public Error() { 51 messages = new Hashtable (); 52 } 53 54 59 public void setId(String id) { 60 this.id = id; 61 } 62 63 64 69 public String getId() { 70 return id; 71 } 72 73 74 80 public void setMessage(String language, 81 String message) { 82 this.messages.put(language, message); 83 } 84 85 86 93 public String getMessage(String language) { 94 return (String ) messages.get(language); 95 } 96 97 98 103 public void setMessages(Hashtable msgs) { 104 this.messages = msgs; 105 } 106 107 108 113 public Hashtable getMessages() { 114 return messages; 115 } 116 117 118 123 public void setType(String t) { 124 this.type = t; 125 } 126 127 128 133 public String getType() { 134 return type; 135 } 136 137 138 144 public void addMessage(Message message) { 145 messages.put(message.getLanguage(), message.getMessage()); 146 logCat.info("Language " + message.getLanguage() + " Message " 147 + message.getMessage()); 148 } 149 150 151 156 public String toString() { 157 StringBuffer buf = new StringBuffer (); 158 buf.append("id="); 159 buf.append(this.getId()); 160 buf.append(" type="); 161 buf.append(this.getType()); 162 163 return buf.toString(); 164 } 165 } 166 | Popular Tags |