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.builder.binding.xml.types;
9   
10  /**
11   * Class FieldTypeVisibilityType.
12   * 
13   * @version $Revision$ $Date$
14   */
15  public class FieldTypeVisibilityType implements java.io.Serializable {
16  
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * The public type
24       */
25      public static final int PUBLIC_TYPE = 0;
26  
27      /**
28       * The instance of the public type
29       */
30      public static final FieldTypeVisibilityType PUBLIC = new FieldTypeVisibilityType(PUBLIC_TYPE, "public");
31  
32      /**
33       * The protected type
34       */
35      public static final int PROTECTED_TYPE = 1;
36  
37      /**
38       * The instance of the protected type
39       */
40      public static final FieldTypeVisibilityType PROTECTED = new FieldTypeVisibilityType(PROTECTED_TYPE, "protected");
41  
42      /**
43       * The private type
44       */
45      public static final int PRIVATE_TYPE = 2;
46  
47      /**
48       * The instance of the private type
49       */
50      public static final FieldTypeVisibilityType PRIVATE = new FieldTypeVisibilityType(PRIVATE_TYPE, "private");
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 FieldTypeVisibilityType(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 FieldTypeVisibilityType
86       * 
87       * @return an Enumeration over all possible instances of
88       * FieldTypeVisibilityType
89       */
90      public static java.util.Enumeration enumerate(
91      ) {
92          return _memberTable.elements();
93      }
94  
95      /**
96       * Method getType.Returns the type of this
97       * FieldTypeVisibilityType
98       * 
99       * @return the type of this FieldTypeVisibilityType
100      */
101     public int getType(
102     ) {
103         return this.type;
104     }
105 
106     /**
107      * Method init.
108      * 
109      * @return the initialized Hashtable for the member table
110      */
111     private static java.util.Hashtable init(
112     ) {
113         java.util.Hashtable members = new java.util.Hashtable();
114         members.put("public", PUBLIC);
115         members.put("protected", PROTECTED);
116         members.put("private", PRIVATE);
117         return members;
118     }
119 
120     /**
121      * Method readResolve. will be called during deserialization to
122      * replace the deserialized object with the correct constant
123      * instance.
124      * 
125      * @return this deserialized object
126      */
127     private java.lang.Object readResolve(
128     ) {
129         return valueOf(this.stringValue);
130     }
131 
132     /**
133      * Method toString.Returns the String representation of this
134      * FieldTypeVisibilityType
135      * 
136      * @return the String representation of this
137      * FieldTypeVisibilityType
138      */
139     public java.lang.String toString(
140     ) {
141         return this.stringValue;
142     }
143 
144     /**
145      * Method valueOf.Returns a new FieldTypeVisibilityType based
146      * on the given String value.
147      * 
148      * @param string
149      * @return the FieldTypeVisibilityType value of parameter
150      * 'string'
151      */
152     public static org.exolab.castor.builder.binding.xml.types.FieldTypeVisibilityType valueOf(
153             final java.lang.String string) {
154         java.lang.Object obj = null;
155         if (string != null) {
156             obj = _memberTable.get(string);
157         }
158         if (obj == null) {
159             String err = "" + string + " is not a valid FieldTypeVisibilityType";
160             throw new IllegalArgumentException(err);
161         }
162         return (FieldTypeVisibilityType) obj;
163     }
164 
165 }