1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.engine.schema.config.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
22
23
24
25 public class AttributeSourceType implements java.io.Serializable {
26
27
28
29
30
31
32
33
34
35 public static final int ADAPTORDEFAULTS_TYPE = 0;
36
37
38
39
40 public static final AttributeSourceType ADAPTORDEFAULTS = new AttributeSourceType(ADAPTORDEFAULTS_TYPE, "AdaptorDefaults");
41
42
43
44
45 public static final int ENGINECONFIGURATION_TYPE = 1;
46
47
48
49
50 public static final AttributeSourceType ENGINECONFIGURATION = new AttributeSourceType(ENGINECONFIGURATION_TYPE, "EngineConfiguration");
51
52
53
54
55 public static final int USERPROPERTIES_TYPE = 2;
56
57
58
59
60 public static final AttributeSourceType USERPROPERTIES = new AttributeSourceType(USERPROPERTIES_TYPE, "UserProperties");
61
62
63
64
65 private static java.util.Hashtable _memberTable = init();
66
67
68
69
70 private int type = -1;
71
72
73
74
75 private java.lang.String stringValue = null;
76
77
78
79
80
81
82 private AttributeSourceType(int type, java.lang.String value)
83 {
84 super();
85 this.type = type;
86 this.stringValue = value;
87 }
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102 public static java.util.Enumeration enumerate()
103 {
104 return _memberTable.elements();
105 }
106
107
108
109
110
111
112
113
114 public int getType()
115 {
116 return this.type;
117 }
118
119
120
121
122
123
124
125
126 private static java.util.Hashtable init()
127 {
128 Hashtable members = new Hashtable();
129 members.put("AdaptorDefaults", ADAPTORDEFAULTS);
130 members.put("EngineConfiguration", ENGINECONFIGURATION);
131 members.put("UserProperties", USERPROPERTIES);
132 return members;
133 }
134
135
136
137
138
139
140
141
142
143
144 private java.lang.Object readResolve()
145 {
146 return valueOf(this.stringValue);
147 }
148
149
150
151
152
153
154
155
156
157 public java.lang.String toString()
158 {
159 return this.stringValue;
160 }
161
162
163
164
165
166
167
168
169
170
171 public static fr.in2p3.jsaga.engine.schema.config.types.AttributeSourceType valueOf(java.lang.String string)
172 {
173 java.lang.Object obj = null;
174 if (string != null) obj = _memberTable.get(string);
175 if (obj == null) {
176 String err = "'" + string + "' is not a valid AttributeSourceType";
177 throw new IllegalArgumentException(err);
178 }
179 return (AttributeSourceType) obj;
180 }
181
182 }