1 /* 2 * This class was automatically generated with 3 * <a href="http://www.castor.org">Castor 1.0.2</a>, using an XML 4 * Schema. 5 * $Id: BindXmlNodeType.java 6075 2006-08-18 08:37:11Z wguttmn $ 6 */ 7 8 package org.exolab.castor.mapping.xml.types; 9 10 //---------------------------------/ 11 //- Imported classes and packages -/ 12 //---------------------------------/ 13 14 import java.util.Hashtable; 15 16 /** 17 * Class BindXmlNodeType. 18 * 19 * @version $Revision: 6075 $ $Date: 2006-01-07 15:48:31 -0700 (Sat, 07 Jan 2006) $ 20 */ 21 public class BindXmlNodeType implements java.io.Serializable { 22 23 24 //--------------------------/ 25 //- Class/Member Variables -/ 26 //--------------------------/ 27 28 /** 29 * The attribute type 30 */ 31 public static final int ATTRIBUTE_TYPE = 0; 32 33 /** 34 * The instance of the attribute type 35 */ 36 public static final BindXmlNodeType ATTRIBUTE = new BindXmlNodeType(ATTRIBUTE_TYPE, "attribute"); 37 38 /** 39 * The element type 40 */ 41 public static final int ELEMENT_TYPE = 1; 42 43 /** 44 * The instance of the element type 45 */ 46 public static final BindXmlNodeType ELEMENT = new BindXmlNodeType(ELEMENT_TYPE, "element"); 47 48 /** 49 * The namespace type 50 */ 51 public static final int NAMESPACE_TYPE = 2; 52 53 /** 54 * The instance of the namespace type 55 */ 56 public static final BindXmlNodeType NAMESPACE = new BindXmlNodeType(NAMESPACE_TYPE, "namespace"); 57 58 /** 59 * The text type 60 */ 61 public static final int TEXT_TYPE = 3; 62 63 /** 64 * The instance of the text type 65 */ 66 public static final BindXmlNodeType TEXT = new BindXmlNodeType(TEXT_TYPE, "text"); 67 68 /** 69 * Field _memberTable 70 */ 71 private static java.util.Hashtable _memberTable = init(); 72 73 /** 74 * Field type 75 */ 76 private int type = -1; 77 78 /** 79 * Field stringValue 80 */ 81 private java.lang.String stringValue = null; 82 83 84 //----------------/ 85 //- Constructors -/ 86 //----------------/ 87 88 private BindXmlNodeType(int type, java.lang.String value) 89 { 90 super(); 91 this.type = type; 92 this.stringValue = value; 93 } //-- org.exolab.castor.mapping.xml.types.BindXmlNodeType(int, java.lang.String) 94 95 96 //-----------/ 97 //- Methods -/ 98 //-----------/ 99 100 /** 101 * Method enumerate 102 * 103 * Returns an enumeration of all possible instances of 104 * BindXmlNodeType 105 * 106 * @return Enumeration 107 */ 108 public static java.util.Enumeration enumerate() 109 { 110 return _memberTable.elements(); 111 } //-- java.util.Enumeration enumerate() 112 113 /** 114 * Method getType 115 * 116 * Returns the type of this BindXmlNodeType 117 * 118 * @return int 119 */ 120 public int getType() 121 { 122 return this.type; 123 } //-- int getType() 124 125 /** 126 * Method init 127 * 128 * 129 * 130 * @return Hashtable 131 */ 132 private static java.util.Hashtable init() 133 { 134 Hashtable members = new Hashtable(); 135 members.put("attribute", ATTRIBUTE); 136 members.put("element", ELEMENT); 137 members.put("namespace", NAMESPACE); 138 members.put("text", TEXT); 139 return members; 140 } //-- java.util.Hashtable init() 141 142 /** 143 * Method readResolve 144 * 145 * will be called during deserialization to replace the 146 * deserialized object with the correct constant instance. 147 * <br/> 148 * 149 * @return Object 150 */ 151 private java.lang.Object readResolve() 152 { 153 return valueOf(this.stringValue); 154 } //-- java.lang.Object readResolve() 155 156 /** 157 * Method toString 158 * 159 * Returns the String representation of this BindXmlNodeType 160 * 161 * @return String 162 */ 163 public java.lang.String toString() 164 { 165 return this.stringValue; 166 } //-- java.lang.String toString() 167 168 /** 169 * Method valueOf 170 * 171 * Returns a new BindXmlNodeType based on the given String 172 * value. 173 * 174 * @param string 175 * @return BindXmlNodeType 176 */ 177 public static org.exolab.castor.mapping.xml.types.BindXmlNodeType valueOf(java.lang.String string) 178 { 179 java.lang.Object obj = null; 180 if (string != null) obj = _memberTable.get(string); 181 if (obj == null) { 182 String err = "'" + string + "' is not a valid BindXmlNodeType"; 183 throw new IllegalArgumentException(err); 184 } 185 return (BindXmlNodeType) obj; 186 } //-- org.exolab.castor.mapping.xml.types.BindXmlNodeType valueOf(java.lang.String) 187 188 }