View Javadoc
1 /* 2 * This class was automatically generated with 3 * <a href="http://castor.exolab.org">Castor 0.9.4</a>, using an 4 * XML Schema. 5 * $Id$ 6 */ 7 8 package org.enableit.db.beans; 9 10 //---------------------------------/ 11 //- Imported classes and packages -/ 12 //---------------------------------/ 13 14 import org.exolab.castor.mapping.AccessMode; 15 import org.exolab.castor.mapping.ClassDescriptor; 16 import org.exolab.castor.mapping.FieldDescriptor; 17 import org.exolab.castor.xml.*; 18 import org.exolab.castor.xml.FieldValidator; 19 import org.exolab.castor.xml.TypeValidator; 20 import org.exolab.castor.xml.XMLFieldDescriptor; 21 import org.exolab.castor.xml.handlers.*; 22 import org.exolab.castor.xml.util.XMLFieldDescriptorImpl; 23 import org.exolab.castor.xml.validators.*; 24 25 /*** 26 * 27 * 28 * @version $Revision$ $Date$ 29 **/ 30 public class TableDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { 31 32 33 //--------------------------/ 34 //- Class/Member Variables -/ 35 //--------------------------/ 36 37 private java.lang.String nsPrefix; 38 39 private java.lang.String nsURI; 40 41 private java.lang.String xmlName; 42 43 private org.exolab.castor.xml.XMLFieldDescriptor identity; 44 45 46 //----------------/ 47 //- Constructors -/ 48 //----------------/ 49 50 public TableDescriptor() { 51 super(); 52 nsURI = "http://darrt.sourceforge.net/schemas/darrt"; 53 xmlName = "table"; 54 55 //-- set grouping compositor 56 setCompositorAsSequence(); 57 XMLFieldDescriptorImpl desc = null; 58 XMLFieldHandler handler = null; 59 FieldValidator fieldValidator = null; 60 //-- initialize attribute descriptors 61 62 //-- initialize element descriptors 63 64 //-- _name 65 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", NodeType.Element); 66 desc.setImmutable(true); 67 handler = (new XMLFieldHandler() { 68 public java.lang.Object getValue( java.lang.Object object ) 69 throws IllegalStateException 70 { 71 Table target = (Table) object; 72 return target.getName(); 73 } 74 public void setValue( java.lang.Object object, java.lang.Object value) 75 throws IllegalStateException, IllegalArgumentException 76 { 77 try { 78 Table target = (Table) object; 79 target.setName( (java.lang.String) value); 80 } 81 catch (Exception ex) { 82 throw new IllegalStateException(ex.toString()); 83 } 84 } 85 public java.lang.Object newInstance( java.lang.Object parent ) { 86 return null; 87 } 88 } ); 89 desc.setHandler(handler); 90 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 91 desc.setRequired(true); 92 desc.setMultivalued(false); 93 addFieldDescriptor(desc); 94 95 //-- validation code for: _name 96 fieldValidator = new FieldValidator(); 97 fieldValidator.setMinOccurs(1); 98 { //-- local scope 99 StringValidator typeValidator = new StringValidator(); 100 typeValidator.setWhiteSpace("preserve"); 101 fieldValidator.setValidator(typeValidator); 102 } 103 desc.setValidator(fieldValidator); 104 //-- _type 105 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", NodeType.Element); 106 desc.setImmutable(true); 107 handler = (new XMLFieldHandler() { 108 public java.lang.Object getValue( java.lang.Object object ) 109 throws IllegalStateException 110 { 111 Table target = (Table) object; 112 return target.getType(); 113 } 114 public void setValue( java.lang.Object object, java.lang.Object value) 115 throws IllegalStateException, IllegalArgumentException 116 { 117 try { 118 Table target = (Table) object; 119 target.setType( (java.lang.String) value); 120 } 121 catch (Exception ex) { 122 throw new IllegalStateException(ex.toString()); 123 } 124 } 125 public java.lang.Object newInstance( java.lang.Object parent ) { 126 return null; 127 } 128 } ); 129 desc.setHandler(handler); 130 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 131 desc.setRequired(true); 132 desc.setMultivalued(false); 133 addFieldDescriptor(desc); 134 135 //-- validation code for: _type 136 fieldValidator = new FieldValidator(); 137 fieldValidator.setMinOccurs(1); 138 { //-- local scope 139 StringValidator typeValidator = new StringValidator(); 140 typeValidator.setWhiteSpace("preserve"); 141 fieldValidator.setValidator(typeValidator); 142 } 143 desc.setValidator(fieldValidator); 144 //-- _columnList 145 desc = new XMLFieldDescriptorImpl(Column.class, "_columnList", "column", NodeType.Element); 146 handler = (new XMLFieldHandler() { 147 public java.lang.Object getValue( java.lang.Object object ) 148 throws IllegalStateException 149 { 150 Table target = (Table) object; 151 return target.getColumn(); 152 } 153 public void setValue( java.lang.Object object, java.lang.Object value) 154 throws IllegalStateException, IllegalArgumentException 155 { 156 try { 157 Table target = (Table) object; 158 target.addColumn( (Column) value); 159 } 160 catch (Exception ex) { 161 throw new IllegalStateException(ex.toString()); 162 } 163 } 164 public java.lang.Object newInstance( java.lang.Object parent ) { 165 return new Column(); 166 } 167 } ); 168 desc.setHandler(handler); 169 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 170 desc.setRequired(true); 171 desc.setMultivalued(true); 172 addFieldDescriptor(desc); 173 174 //-- validation code for: _columnList 175 fieldValidator = new FieldValidator(); 176 fieldValidator.setMinOccurs(1); 177 { //-- local scope 178 } 179 desc.setValidator(fieldValidator); 180 //-- _indexList 181 desc = new XMLFieldDescriptorImpl(Index.class, "_indexList", "index", NodeType.Element); 182 handler = (new XMLFieldHandler() { 183 public java.lang.Object getValue( java.lang.Object object ) 184 throws IllegalStateException 185 { 186 Table target = (Table) object; 187 return target.getIndex(); 188 } 189 public void setValue( java.lang.Object object, java.lang.Object value) 190 throws IllegalStateException, IllegalArgumentException 191 { 192 try { 193 Table target = (Table) object; 194 target.addIndex( (Index) value); 195 } 196 catch (Exception ex) { 197 throw new IllegalStateException(ex.toString()); 198 } 199 } 200 public java.lang.Object newInstance( java.lang.Object parent ) { 201 return new Index(); 202 } 203 } ); 204 desc.setHandler(handler); 205 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 206 desc.setMultivalued(true); 207 addFieldDescriptor(desc); 208 209 //-- validation code for: _indexList 210 fieldValidator = new FieldValidator(); 211 fieldValidator.setMinOccurs(0); 212 { //-- local scope 213 } 214 desc.setValidator(fieldValidator); 215 } //-- org.enableit.db.beans.TableDescriptor() 216 217 218 //-----------/ 219 //- Methods -/ 220 //-----------/ 221 222 /*** 223 **/ 224 public org.exolab.castor.mapping.AccessMode getAccessMode() 225 { 226 return null; 227 } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 228 229 /*** 230 **/ 231 public org.exolab.castor.mapping.ClassDescriptor getExtends() 232 { 233 return null; 234 } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 235 236 /*** 237 **/ 238 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 239 { 240 return identity; 241 } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 242 243 /*** 244 **/ 245 public java.lang.Class getJavaClass() 246 { 247 return org.enableit.db.beans.Table.class; 248 } //-- java.lang.Class getJavaClass() 249 250 /*** 251 **/ 252 public java.lang.String getNameSpacePrefix() 253 { 254 return nsPrefix; 255 } //-- java.lang.String getNameSpacePrefix() 256 257 /*** 258 **/ 259 public java.lang.String getNameSpaceURI() 260 { 261 return nsURI; 262 } //-- java.lang.String getNameSpaceURI() 263 264 /*** 265 **/ 266 public org.exolab.castor.xml.TypeValidator getValidator() 267 { 268 return this; 269 } //-- org.exolab.castor.xml.TypeValidator getValidator() 270 271 /*** 272 **/ 273 public java.lang.String getXMLName() 274 { 275 return xmlName; 276 } //-- java.lang.String getXMLName() 277 278 }

This page was automatically generated by Maven