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