KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > validator > ErrorMessage


1 package org.sapia.validator;
2
3
4 /**
5  * Models an error message.
6  *
7  * @author Yanick Duchesne
8  * <dl>
9  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
10  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
11  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
12  * </dl>
13  */

14 public class ErrorMessage {
15   private String JavaDoc _msg;
16   private String JavaDoc _locale;
17   private String JavaDoc _id;
18
19   /**
20    * Constructor for ErrorMessage.
21    */

22   public ErrorMessage() {
23   }
24   
25   /**
26    * Sets this message's identifier.
27    *
28    * @param id an arbitrary identifier.
29    */

30   void setId(String JavaDoc id) {
31     _id = id;
32   }
33   
34   /**
35    * Sets this message's string value.
36    *
37    * @param this message's "string value".
38    */

39   public void setValue(String JavaDoc msg) {
40     _msg = msg;
41   }
42   
43   /**
44    * Returns this message's string value.
45    *
46    * @return this message's string value.
47    */

48   public String JavaDoc getValue() {
49     return _msg;
50   }
51
52   /**
53    * Returns this message's locale.
54    *
55    * @return this message's locale, as a string.
56    *
57    * @see #setLocale(String)
58    */

59   public String JavaDoc getLocale() {
60     return _locale;
61   }
62   
63   /**
64    * Sets this message's locale.
65    *
66    * @param this message's locale, as a path of the form: <code>language/country/variant</code>.
67    */

68   public void setLocale(String JavaDoc path) {
69     _locale = path;
70   }
71   
72   /**
73    * @see Object#toString()
74    */

75   public String JavaDoc toString() {
76     return "[ " + _msg + " ] ";
77   }
78 }
79
Popular Tags