View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor.types;
9   
10  /**
11   * Class TypeType.
12   * 
13   * @version $Revision$ $Date$
14   */
15  public class TypeType implements java.io.Serializable {
16  
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * The Marshal type
24       */
25      public static final int MARSHAL_TYPE = 0;
26  
27      /**
28       * The instance of the Marshal type
29       */
30      public static final TypeType MARSHAL = new TypeType(MARSHAL_TYPE, "Marshal");
31  
32      /**
33       * The Unmarshal type
34       */
35      public static final int UNMARSHAL_TYPE = 1;
36  
37      /**
38       * The instance of the Unmarshal type
39       */
40      public static final TypeType UNMARSHAL = new TypeType(UNMARSHAL_TYPE, "Unmarshal");
41  
42      /**
43       * The Both type
44       */
45      public static final int BOTH_TYPE = 2;
46  
47      /**
48       * The instance of the Both type
49       */
50      public static final TypeType BOTH = new TypeType(BOTH_TYPE, "Both");
51  
52      /**
53       * Field _memberTable.
54       */
55      private static java.util.Hashtable _memberTable = init();
56  
57      /**
58       * Field type.
59       */
60      private final int type;
61  
62      /**
63       * Field stringValue.
64       */
65      private java.lang.String stringValue = null;
66  
67  
68        //----------------/
69       //- Constructors -/
70      //----------------/
71  
72      private TypeType(final int type, final java.lang.String value) {
73          super();
74          this.type = type;
75          this.stringValue = value;
76      }
77  
78  
79        //-----------/
80       //- Methods -/
81      //-----------/
82  
83      /**
84       * Method enumerate.Returns an enumeration of all possible
85       * instances of TypeType
86       * 
87       * @return an Enumeration over all possible instances of TypeTyp
88       */
89      public static java.util.Enumeration enumerate(
90      ) {
91          return _memberTable.elements();
92      }
93  
94      /**
95       * Method getType.Returns the type of this TypeType
96       * 
97       * @return the type of this TypeType
98       */
99      public int getType(
100     ) {
101         return this.type;
102     }
103 
104     /**
105      * Method init.
106      * 
107      * @return the initialized Hashtable for the member table
108      */
109     private static java.util.Hashtable init(
110     ) {
111         java.util.Hashtable members = new java.util.Hashtable();
112         members.put("Marshal", MARSHAL);
113         members.put("Unmarshal", UNMARSHAL);
114         members.put("Both", BOTH);
115         return members;
116     }
117 
118     /**
119      * Method readResolve. will be called during deserialization to
120      * replace the deserialized object with the correct constant
121      * instance.
122      * 
123      * @return this deserialized object
124      */
125     private java.lang.Object readResolve(
126     ) {
127         return valueOf(this.stringValue);
128     }
129 
130     /**
131      * Method toString.Returns the String representation of this
132      * TypeType
133      * 
134      * @return the String representation of this TypeType
135      */
136     public java.lang.String toString(
137     ) {
138         return this.stringValue;
139     }
140 
141     /**
142      * Method valueOf.Returns a new TypeType based on the given
143      * String value.
144      * 
145      * @param string
146      * @return the TypeType value of parameter 'string'
147      */
148     public static org.exolab.castor.tests.framework.testDescriptor.types.TypeType valueOf(
149             final java.lang.String string) {
150         java.lang.Object obj = null;
151         if (string != null) {
152             obj = _memberTable.get(string);
153         }
154         if (obj == null) {
155             String err = "" + string + " is not a valid TypeType";
156             throw new IllegalArgumentException(err);
157         }
158         return (TypeType) obj;
159     }
160 
161 }