01: package nl.knowlogy.validation;
02:
03: import java.util.Iterator;
04:
05: import org.apache.commons.lang.enums.Enum;
06:
07: /**
08: * <p>
09: * A type of Message. The constants of this enumerated type provide a simple classification of types
10: * of messages declared in <code>Message</code>.
11: * </p>
12: * <p>
13: * Message type can be a one of the following
14: * <ul>
15: * <li>Error</li>
16: * <li>Warning</li>
17: * <li>Info</li>
18: * </ul>
19: *
20: * @author <a href="mailto:robert.hofstra@knowlogy.nl">Robert Hofstra, Knowlogy</a>
21: *
22: */
23: public class MessageType extends Enum {
24:
25: public static final long serialVersionUID = 0;
26:
27: public static final MessageType ERROR = new MessageType("Error");
28: public static final MessageType WARNING = new MessageType("Warning");
29: public static final MessageType INFO = new MessageType("Info");
30:
31: private MessageType(String name) {
32: super (name);
33: }
34:
35: public static MessageType getEnum(String name) {
36: return (MessageType) getEnum(MessageType.class, name);
37: }
38:
39: public static Iterator iterator() {
40: return iterator(MessageType.class);
41: }
42: }
|