001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 1.0.2</a>, using an XML
004: * Schema.
005: * $Id: SqlDescriptor.java 6104 2006-08-23 06:32:44Z wguttmn $
006: */
007:
008: package org.exolab.castor.mapping.xml;
009:
010: /**
011: * Class SqlDescriptor.
012: *
013: * @version $Revision: 6104 $ $Date: 2006-01-07 15:48:31 -0700 (Sat, 07 Jan 2006) $
014: */
015: public class SqlDescriptor extends
016: org.exolab.castor.xml.util.XMLClassDescriptorImpl {
017:
018: //--------------------------/
019: //- Class/Member Variables -/
020: //--------------------------/
021:
022: /**
023: * Field elementDefinition
024: */
025: private boolean elementDefinition;
026:
027: /**
028: * Field nsPrefix
029: */
030: private java.lang.String nsPrefix;
031:
032: /**
033: * Field nsURI
034: */
035: private java.lang.String nsURI;
036:
037: /**
038: * Field xmlName
039: */
040: private java.lang.String xmlName;
041:
042: /**
043: * Field identity
044: */
045: private org.exolab.castor.xml.XMLFieldDescriptor identity;
046:
047: //----------------/
048: //- Constructors -/
049: //----------------/
050:
051: public SqlDescriptor() {
052: super ();
053: nsURI = "http://castor.exolab.org/";
054: xmlName = "sql";
055: elementDefinition = true;
056: org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
057: org.exolab.castor.mapping.FieldHandler handler = null;
058: org.exolab.castor.xml.FieldValidator fieldValidator = null;
059: //-- initialize attribute descriptors
060:
061: //-- _name
062: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
063: java.lang.String.class, "_name", "name",
064: org.exolab.castor.xml.NodeType.Attribute);
065: handler = new org.exolab.castor.xml.XMLFieldHandler() {
066: public java.lang.Object getValue(java.lang.Object object)
067: throws IllegalStateException {
068: Sql target = (Sql) object;
069: return target.getName();
070: }
071:
072: public void setValue(java.lang.Object object,
073: java.lang.Object value)
074: throws IllegalStateException,
075: IllegalArgumentException {
076: try {
077: Sql target = (Sql) object;
078: target.addName((java.lang.String) value);
079: } catch (java.lang.Exception ex) {
080: throw new IllegalStateException(ex.toString());
081: }
082: }
083:
084: public java.lang.Object newInstance(java.lang.Object parent) {
085: return new java.lang.String();
086: }
087: };
088: handler = new org.exolab.castor.xml.handlers.CollectionFieldHandler(
089: handler,
090: new org.exolab.castor.xml.validators.NameValidator(
091: org.exolab.castor.xml.validators.NameValidator.NMTOKEN));
092: desc.setHandler(handler);
093: desc.setMultivalued(true);
094: addFieldDescriptor(desc);
095:
096: //-- validation code for: _name
097: fieldValidator = new org.exolab.castor.xml.FieldValidator();
098: fieldValidator.setMinOccurs(0);
099: //-- _type
100: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
101: java.lang.String.class, "_type", "type",
102: org.exolab.castor.xml.NodeType.Attribute);
103: desc.setImmutable(true);
104: handler = new org.exolab.castor.xml.XMLFieldHandler() {
105: public java.lang.Object getValue(java.lang.Object object)
106: throws IllegalStateException {
107: Sql target = (Sql) object;
108: return target.getType();
109: }
110:
111: public void setValue(java.lang.Object object,
112: java.lang.Object value)
113: throws IllegalStateException,
114: IllegalArgumentException {
115: try {
116: Sql target = (Sql) object;
117: target.setType((java.lang.String) value);
118: } catch (java.lang.Exception ex) {
119: throw new IllegalStateException(ex.toString());
120: }
121: }
122:
123: public java.lang.Object newInstance(java.lang.Object parent) {
124: return null;
125: }
126: };
127: desc.setHandler(handler);
128: desc.setMultivalued(false);
129: addFieldDescriptor(desc);
130:
131: //-- validation code for: _type
132: fieldValidator = new org.exolab.castor.xml.FieldValidator();
133: { //-- local scope
134: org.exolab.castor.xml.validators.StringValidator typeValidator = new org.exolab.castor.xml.validators.StringValidator();
135: typeValidator.setWhiteSpace("preserve");
136: fieldValidator.setValidator(typeValidator);
137: }
138: desc.setValidator(fieldValidator);
139: //-- _manyTable
140: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
141: java.lang.String.class, "_manyTable", "many-table",
142: org.exolab.castor.xml.NodeType.Attribute);
143: handler = new org.exolab.castor.xml.XMLFieldHandler() {
144: public java.lang.Object getValue(java.lang.Object object)
145: throws IllegalStateException {
146: Sql target = (Sql) object;
147: return target.getManyTable();
148: }
149:
150: public void setValue(java.lang.Object object,
151: java.lang.Object value)
152: throws IllegalStateException,
153: IllegalArgumentException {
154: try {
155: Sql target = (Sql) object;
156: target.setManyTable((java.lang.String) value);
157: } catch (java.lang.Exception ex) {
158: throw new IllegalStateException(ex.toString());
159: }
160: }
161:
162: public java.lang.Object newInstance(java.lang.Object parent) {
163: return new java.lang.String();
164: }
165: };
166: desc.setHandler(handler);
167: desc.setMultivalued(false);
168: addFieldDescriptor(desc);
169:
170: //-- validation code for: _manyTable
171: fieldValidator = new org.exolab.castor.xml.FieldValidator();
172: { //-- local scope
173: org.exolab.castor.xml.validators.NameValidator typeValidator = new org.exolab.castor.xml.validators.NameValidator(
174: org.exolab.castor.xml.validators.NameValidator.NMTOKEN);
175: fieldValidator.setValidator(typeValidator);
176: }
177: desc.setValidator(fieldValidator);
178: //-- _manyKey
179: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
180: java.lang.String.class, "_manyKey", "many-key",
181: org.exolab.castor.xml.NodeType.Attribute);
182: handler = new org.exolab.castor.xml.XMLFieldHandler() {
183: public java.lang.Object getValue(java.lang.Object object)
184: throws IllegalStateException {
185: Sql target = (Sql) object;
186: return target.getManyKey();
187: }
188:
189: public void setValue(java.lang.Object object,
190: java.lang.Object value)
191: throws IllegalStateException,
192: IllegalArgumentException {
193: try {
194: Sql target = (Sql) object;
195: target.addManyKey((java.lang.String) value);
196: } catch (java.lang.Exception ex) {
197: throw new IllegalStateException(ex.toString());
198: }
199: }
200:
201: public java.lang.Object newInstance(java.lang.Object parent) {
202: return new java.lang.String();
203: }
204: };
205: handler = new org.exolab.castor.xml.handlers.CollectionFieldHandler(
206: handler,
207: new org.exolab.castor.xml.validators.NameValidator(
208: org.exolab.castor.xml.validators.NameValidator.NMTOKEN));
209: desc.setHandler(handler);
210: desc.setMultivalued(true);
211: addFieldDescriptor(desc);
212:
213: //-- validation code for: _manyKey
214: fieldValidator = new org.exolab.castor.xml.FieldValidator();
215: fieldValidator.setMinOccurs(0);
216: //-- _readOnly
217: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
218: java.lang.Boolean.TYPE, "_readOnly", "read-only",
219: org.exolab.castor.xml.NodeType.Attribute);
220: handler = new org.exolab.castor.xml.XMLFieldHandler() {
221: public java.lang.Object getValue(java.lang.Object object)
222: throws IllegalStateException {
223: Sql target = (Sql) object;
224: if (!target.hasReadOnly())
225: return null;
226: return (target.getReadOnly() ? java.lang.Boolean.TRUE
227: : java.lang.Boolean.FALSE);
228: }
229:
230: public void setValue(java.lang.Object object,
231: java.lang.Object value)
232: throws IllegalStateException,
233: IllegalArgumentException {
234: try {
235: Sql target = (Sql) object;
236: // if null, use delete method for optional primitives
237: if (value == null) {
238: target.deleteReadOnly();
239: return;
240: }
241: target.setReadOnly(((java.lang.Boolean) value)
242: .booleanValue());
243: } catch (java.lang.Exception ex) {
244: throw new IllegalStateException(ex.toString());
245: }
246: }
247:
248: public java.lang.Object newInstance(java.lang.Object parent) {
249: return null;
250: }
251: };
252: desc.setHandler(handler);
253: desc.setMultivalued(false);
254: addFieldDescriptor(desc);
255:
256: //-- validation code for: _readOnly
257: fieldValidator = new org.exolab.castor.xml.FieldValidator();
258: { //-- local scope
259: org.exolab.castor.xml.validators.BooleanValidator typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
260: fieldValidator.setValidator(typeValidator);
261: }
262: desc.setValidator(fieldValidator);
263: //-- _transient
264: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
265: java.lang.Boolean.TYPE, "_transient", "transient",
266: org.exolab.castor.xml.NodeType.Attribute);
267: handler = new org.exolab.castor.xml.XMLFieldHandler() {
268: public java.lang.Object getValue(java.lang.Object object)
269: throws IllegalStateException {
270: Sql target = (Sql) object;
271: if (!target.hasTransient())
272: return null;
273: return (target.getTransient() ? java.lang.Boolean.TRUE
274: : java.lang.Boolean.FALSE);
275: }
276:
277: public void setValue(java.lang.Object object,
278: java.lang.Object value)
279: throws IllegalStateException,
280: IllegalArgumentException {
281: try {
282: Sql target = (Sql) object;
283: // if null, use delete method for optional primitives
284: if (value == null) {
285: target.deleteTransient();
286: return;
287: }
288: target.setTransient(((java.lang.Boolean) value)
289: .booleanValue());
290: } catch (java.lang.Exception ex) {
291: throw new IllegalStateException(ex.toString());
292: }
293: }
294:
295: public java.lang.Object newInstance(java.lang.Object parent) {
296: return null;
297: }
298: };
299: desc.setHandler(handler);
300: desc.setMultivalued(false);
301: addFieldDescriptor(desc);
302:
303: //-- validation code for: _transient
304: fieldValidator = new org.exolab.castor.xml.FieldValidator();
305: { //-- local scope
306: org.exolab.castor.xml.validators.BooleanValidator typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
307: fieldValidator.setValidator(typeValidator);
308: }
309: desc.setValidator(fieldValidator);
310: //-- _dirty
311: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
312: org.exolab.castor.mapping.xml.types.SqlDirtyType.class,
313: "_dirty", "dirty",
314: org.exolab.castor.xml.NodeType.Attribute);
315: handler = new org.exolab.castor.xml.XMLFieldHandler() {
316: public java.lang.Object getValue(java.lang.Object object)
317: throws IllegalStateException {
318: Sql target = (Sql) object;
319: return target.getDirty();
320: }
321:
322: public void setValue(java.lang.Object object,
323: java.lang.Object value)
324: throws IllegalStateException,
325: IllegalArgumentException {
326: try {
327: Sql target = (Sql) object;
328: target
329: .setDirty((org.exolab.castor.mapping.xml.types.SqlDirtyType) value);
330: } catch (java.lang.Exception ex) {
331: throw new IllegalStateException(ex.toString());
332: }
333: }
334:
335: public java.lang.Object newInstance(java.lang.Object parent) {
336: return null;
337: }
338: };
339: handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
340: org.exolab.castor.mapping.xml.types.SqlDirtyType.class,
341: handler);
342: desc.setImmutable(true);
343: desc.setHandler(handler);
344: desc.setMultivalued(false);
345: addFieldDescriptor(desc);
346:
347: //-- validation code for: _dirty
348: fieldValidator = new org.exolab.castor.xml.FieldValidator();
349: { //-- local scope
350: }
351: desc.setValidator(fieldValidator);
352: //-- initialize element descriptors
353:
354: } //-- org.exolab.castor.mapping.xml.SqlDescriptor()
355:
356: //-----------/
357: //- Methods -/
358: //-----------/
359:
360: /**
361: * Method getAccessMode
362: *
363: *
364: *
365: * @return AccessMode
366: */
367: public org.exolab.castor.mapping.AccessMode getAccessMode() {
368: return null;
369: } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
370:
371: /**
372: * Method getExtends
373: *
374: *
375: *
376: * @return ClassDescriptor
377: */
378: public org.exolab.castor.mapping.ClassDescriptor getExtends() {
379: return null;
380: } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
381:
382: /**
383: * Method getIdentity
384: *
385: *
386: *
387: * @return FieldDescriptor
388: */
389: public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
390: return identity;
391: } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
392:
393: /**
394: * Method getJavaClass
395: *
396: *
397: *
398: * @return Class
399: */
400: public java.lang.Class getJavaClass() {
401: return org.exolab.castor.mapping.xml.Sql.class;
402: } //-- java.lang.Class getJavaClass()
403:
404: /**
405: * Method getNameSpacePrefix
406: *
407: *
408: *
409: * @return String
410: */
411: public java.lang.String getNameSpacePrefix() {
412: return nsPrefix;
413: } //-- java.lang.String getNameSpacePrefix()
414:
415: /**
416: * Method getNameSpaceURI
417: *
418: *
419: *
420: * @return String
421: */
422: public java.lang.String getNameSpaceURI() {
423: return nsURI;
424: } //-- java.lang.String getNameSpaceURI()
425:
426: /**
427: * Method getValidator
428: *
429: *
430: *
431: * @return TypeValidator
432: */
433: public org.exolab.castor.xml.TypeValidator getValidator() {
434: return this ;
435: } //-- org.exolab.castor.xml.TypeValidator getValidator()
436:
437: /**
438: * Method getXMLName
439: *
440: *
441: *
442: * @return String
443: */
444: public java.lang.String getXMLName() {
445: return xmlName;
446: } //-- java.lang.String getXMLName()
447:
448: /**
449: * Method isElementDefinition
450: *
451: *
452: *
453: * @return boolean
454: */
455: public boolean isElementDefinition() {
456: return elementDefinition;
457: } //-- boolean isElementDefinition()
458:
459: }
|