1
2
3
4
5
6
7
8 package org.exolab.castor.builder.binding.xml.types;
9
10
11
12
13
14
15
16
17
18
19 public class BindingType implements java.io.Serializable {
20
21
22
23
24
25
26
27
28
29 public static final int ELEMENT_TYPE = 0;
30
31
32
33
34 public static final BindingType ELEMENT = new BindingType(ELEMENT_TYPE, "element");
35
36
37
38
39 public static final int TYPE_TYPE = 1;
40
41
42
43
44 public static final BindingType TYPE = new BindingType(TYPE_TYPE, "type");
45
46
47
48
49 private static java.util.Hashtable _memberTable = init();
50
51
52
53
54 private final int type;
55
56
57
58
59 private java.lang.String stringValue = null;
60
61
62
63
64
65
66 private BindingType(final int type, final java.lang.String value) {
67 super();
68 this.type = type;
69 this.stringValue = value;
70 }
71
72
73
74
75
76
77
78
79
80
81
82
83
84 public static java.util.Enumeration enumerate(
85 ) {
86 return _memberTable.elements();
87 }
88
89
90
91
92
93
94 public int getType(
95 ) {
96 return this.type;
97 }
98
99
100
101
102
103
104 private static java.util.Hashtable init(
105 ) {
106 java.util.Hashtable members = new java.util.Hashtable();
107 members.put("element", ELEMENT);
108 members.put("type", TYPE);
109 return members;
110 }
111
112
113
114
115
116
117
118
119 private java.lang.Object readResolve(
120 ) {
121 return valueOf(this.stringValue);
122 }
123
124
125
126
127
128
129
130 public java.lang.String toString(
131 ) {
132 return this.stringValue;
133 }
134
135
136
137
138
139
140
141
142 public static org.exolab.castor.builder.binding.xml.types.BindingType valueOf(
143 final java.lang.String string) {
144 java.lang.Object obj = null;
145 if (string != null) {
146 obj = _memberTable.get(string);
147 }
148 if (obj == null) {
149 String err = "" + string + " is not a valid BindingType";
150 throw new IllegalArgumentException(err);
151 }
152 return (BindingType) obj;
153 }
154
155 }