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 DatabaseDescriptor 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 DatabaseDescriptor() { 51 super(); 52 nsURI = "http://darrt.sourceforge.net/schemas/darrt"; 53 xmlName = "database"; 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 //-- _provider 65 desc = new XMLFieldDescriptorImpl(Provider.class, "_provider", "provider", NodeType.Element); 66 handler = (new XMLFieldHandler() { 67 public java.lang.Object getValue( java.lang.Object object ) 68 throws IllegalStateException 69 { 70 Database target = (Database) object; 71 return target.getProvider(); 72 } 73 public void setValue( java.lang.Object object, java.lang.Object value) 74 throws IllegalStateException, IllegalArgumentException 75 { 76 try { 77 Database target = (Database) object; 78 target.setProvider( (Provider) value); 79 } 80 catch (Exception ex) { 81 throw new IllegalStateException(ex.toString()); 82 } 83 } 84 public java.lang.Object newInstance( java.lang.Object parent ) { 85 return new Provider(); 86 } 87 } ); 88 desc.setHandler(handler); 89 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 90 desc.setRequired(true); 91 desc.setMultivalued(false); 92 addFieldDescriptor(desc); 93 94 //-- validation code for: _provider 95 fieldValidator = new FieldValidator(); 96 fieldValidator.setMinOccurs(1); 97 { //-- local scope 98 } 99 desc.setValidator(fieldValidator); 100 //-- _metadata 101 desc = new XMLFieldDescriptorImpl(Metadata.class, "_metadata", "metadata", NodeType.Element); 102 handler = (new XMLFieldHandler() { 103 public java.lang.Object getValue( java.lang.Object object ) 104 throws IllegalStateException 105 { 106 Database target = (Database) object; 107 return target.getMetadata(); 108 } 109 public void setValue( java.lang.Object object, java.lang.Object value) 110 throws IllegalStateException, IllegalArgumentException 111 { 112 try { 113 Database target = (Database) object; 114 target.setMetadata( (Metadata) value); 115 } 116 catch (Exception ex) { 117 throw new IllegalStateException(ex.toString()); 118 } 119 } 120 public java.lang.Object newInstance( java.lang.Object parent ) { 121 return new Metadata(); 122 } 123 } ); 124 desc.setHandler(handler); 125 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 126 desc.setMultivalued(false); 127 addFieldDescriptor(desc); 128 129 //-- validation code for: _metadata 130 fieldValidator = new FieldValidator(); 131 { //-- local scope 132 } 133 desc.setValidator(fieldValidator); 134 //-- _schemaList 135 desc = new XMLFieldDescriptorImpl(Schema.class, "_schemaList", "schema", NodeType.Element); 136 handler = (new XMLFieldHandler() { 137 public java.lang.Object getValue( java.lang.Object object ) 138 throws IllegalStateException 139 { 140 Database target = (Database) object; 141 return target.getSchema(); 142 } 143 public void setValue( java.lang.Object object, java.lang.Object value) 144 throws IllegalStateException, IllegalArgumentException 145 { 146 try { 147 Database target = (Database) object; 148 target.addSchema( (Schema) value); 149 } 150 catch (Exception ex) { 151 throw new IllegalStateException(ex.toString()); 152 } 153 } 154 public java.lang.Object newInstance( java.lang.Object parent ) { 155 return new Schema(); 156 } 157 } ); 158 desc.setHandler(handler); 159 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt"); 160 desc.setMultivalued(true); 161 addFieldDescriptor(desc); 162 163 //-- validation code for: _schemaList 164 fieldValidator = new FieldValidator(); 165 fieldValidator.setMinOccurs(0); 166 { //-- local scope 167 } 168 desc.setValidator(fieldValidator); 169 } //-- org.enableit.db.beans.DatabaseDescriptor() 170 171 172 //-----------/ 173 //- Methods -/ 174 //-----------/ 175 176 /*** 177 **/ 178 public org.exolab.castor.mapping.AccessMode getAccessMode() 179 { 180 return null; 181 } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 182 183 /*** 184 **/ 185 public org.exolab.castor.mapping.ClassDescriptor getExtends() 186 { 187 return null; 188 } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 189 190 /*** 191 **/ 192 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 193 { 194 return identity; 195 } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 196 197 /*** 198 **/ 199 public java.lang.Class getJavaClass() 200 { 201 return org.enableit.db.beans.Database.class; 202 } //-- java.lang.Class getJavaClass() 203 204 /*** 205 **/ 206 public java.lang.String getNameSpacePrefix() 207 { 208 return nsPrefix; 209 } //-- java.lang.String getNameSpacePrefix() 210 211 /*** 212 **/ 213 public java.lang.String getNameSpaceURI() 214 { 215 return nsURI; 216 } //-- java.lang.String getNameSpaceURI() 217 218 /*** 219 **/ 220 public org.exolab.castor.xml.TypeValidator getValidator() 221 { 222 return this; 223 } //-- org.exolab.castor.xml.TypeValidator getValidator() 224 225 /*** 226 **/ 227 public java.lang.String getXMLName() 228 { 229 return xmlName; 230 } //-- java.lang.String getXMLName() 231 232 }

This page was automatically generated by Maven