1
2
3
4
5
6
7
8 package org.astrogrid.applications.beans.v1.types;
9
10
11
12
13
14 import java.io.Serializable;
15 import java.util.Enumeration;
16 import java.util.Hashtable;
17 import org.exolab.castor.xml.Marshaller;
18 import org.exolab.castor.xml.Unmarshaller;
19
20 /***
21 * The type of the underlying application - commandline, http-get
22 * etc
23 *
24 * @version $Revision: 1.8 $ $Date: 2007/01/04 16:26:23 $
25 */
26 public class ApplicationKindType implements java.io.Serializable {
27
28
29
30
31
32
33 /***
34 * The cmdline type
35 */
36 public static final int CMDLINE_TYPE = 0;
37
38 /***
39 * The instance of the cmdline type
40 */
41 public static final ApplicationKindType CMDLINE = new ApplicationKindType(CMDLINE_TYPE, "cmdline");
42
43 /***
44 * The http type
45 */
46 public static final int HTTP_TYPE = 1;
47
48 /***
49 * The instance of the http type
50 */
51 public static final ApplicationKindType HTTP = new ApplicationKindType(HTTP_TYPE, "http");
52
53 /***
54 * The javaclass type
55 */
56 public static final int JAVACLASS_TYPE = 2;
57
58 /***
59 * The instance of the javaclass type
60 */
61 public static final ApplicationKindType JAVACLASS = new ApplicationKindType(JAVACLASS_TYPE, "javaclass");
62
63 /***
64 * Field _memberTable
65 */
66 private static java.util.Hashtable _memberTable = init();
67
68 /***
69 * Field type
70 */
71 private int type = -1;
72
73 /***
74 * Field stringValue
75 */
76 private java.lang.String stringValue = null;
77
78
79
80
81
82
83 private ApplicationKindType(int type, java.lang.String value) {
84 super();
85 this.type = type;
86 this.stringValue = value;
87 }
88
89
90
91
92
93
94 /***
95 * Method enumerateReturns an enumeration of all possible
96 * instances of ApplicationKindType
97 */
98 public static java.util.Enumeration enumerate()
99 {
100 return _memberTable.elements();
101 }
102
103 /***
104 * Method getTypeReturns the type of this ApplicationKindType
105 */
106 public int getType()
107 {
108 return this.type;
109 }
110
111 /***
112 * Method init
113 */
114 private static java.util.Hashtable init()
115 {
116 Hashtable members = new Hashtable();
117 members.put("cmdline", CMDLINE);
118 members.put("http", HTTP);
119 members.put("javaclass", JAVACLASS);
120 return members;
121 }
122
123 /***
124 * Method toStringReturns the String representation of this
125 * ApplicationKindType
126 */
127 public java.lang.String toString()
128 {
129 return this.stringValue;
130 }
131
132 /***
133 * Method valueOfReturns a new ApplicationKindType based on the
134 * given String value.
135 *
136 * @param string
137 */
138 public static org.astrogrid.applications.beans.v1.types.ApplicationKindType valueOf(java.lang.String string)
139 {
140 java.lang.Object obj = null;
141 if (string != null) obj = _memberTable.get(string);
142 if (obj == null) {
143 String err = "'" + string + "' is not a valid ApplicationKindType";
144 throw new IllegalArgumentException(err);
145 }
146 return (ApplicationKindType) obj;
147 }
148
149 }