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