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: BindXmlDescriptor.java 6104 2006-08-23 06:32:44Z wguttmn $
006: */
007:
008: package org.exolab.castor.mapping.xml;
009:
010: /**
011: * Class BindXmlDescriptor.
012: *
013: * @version $Revision: 6104 $ $Date: 2006-01-07 15:48:31 -0700 (Sat, 07 Jan 2006) $
014: */
015: public class BindXmlDescriptor 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 BindXmlDescriptor() {
052: super ();
053: nsURI = "http://castor.exolab.org/";
054: xmlName = "bind-xml";
055: elementDefinition = true;
056:
057: //-- set grouping compositor
058: setCompositorAsSequence();
059: org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
060: org.exolab.castor.mapping.FieldHandler handler = null;
061: org.exolab.castor.xml.FieldValidator fieldValidator = null;
062: //-- initialize attribute descriptors
063:
064: //-- _name
065: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
066: java.lang.String.class, "_name", "name",
067: org.exolab.castor.xml.NodeType.Attribute);
068: desc.setSchemaType("QName");
069: handler = new org.exolab.castor.xml.XMLFieldHandler() {
070: public java.lang.Object getValue(java.lang.Object object)
071: throws IllegalStateException {
072: BindXml target = (BindXml) object;
073: return target.getName();
074: }
075:
076: public void setValue(java.lang.Object object,
077: java.lang.Object value)
078: throws IllegalStateException,
079: IllegalArgumentException {
080: try {
081: BindXml target = (BindXml) object;
082: target.setName((java.lang.String) value);
083: } catch (java.lang.Exception ex) {
084: throw new IllegalStateException(ex.toString());
085: }
086: }
087:
088: public java.lang.Object newInstance(java.lang.Object parent) {
089: return new java.lang.String();
090: }
091: };
092: desc.setHandler(handler);
093: desc.setMultivalued(false);
094: addFieldDescriptor(desc);
095:
096: //-- validation code for: _name
097: fieldValidator = new org.exolab.castor.xml.FieldValidator();
098: { //-- local scope
099: }
100: desc.setValidator(fieldValidator);
101: //-- _type
102: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
103: java.lang.String.class, "_type", "type",
104: org.exolab.castor.xml.NodeType.Attribute);
105: handler = new org.exolab.castor.xml.XMLFieldHandler() {
106: public java.lang.Object getValue(java.lang.Object object)
107: throws IllegalStateException {
108: BindXml target = (BindXml) object;
109: return target.getType();
110: }
111:
112: public void setValue(java.lang.Object object,
113: java.lang.Object value)
114: throws IllegalStateException,
115: IllegalArgumentException {
116: try {
117: BindXml target = (BindXml) object;
118: target.setType((java.lang.String) value);
119: } catch (java.lang.Exception ex) {
120: throw new IllegalStateException(ex.toString());
121: }
122: }
123:
124: public java.lang.Object newInstance(java.lang.Object parent) {
125: return new java.lang.String();
126: }
127: };
128: desc.setHandler(handler);
129: desc.setMultivalued(false);
130: addFieldDescriptor(desc);
131:
132: //-- validation code for: _type
133: fieldValidator = new org.exolab.castor.xml.FieldValidator();
134: { //-- local scope
135: org.exolab.castor.xml.validators.NameValidator typeValidator = new org.exolab.castor.xml.validators.NameValidator(
136: org.exolab.castor.xml.validators.NameValidator.NMTOKEN);
137: fieldValidator.setValidator(typeValidator);
138: }
139: desc.setValidator(fieldValidator);
140: //-- _autoNaming
141: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
142: org.exolab.castor.mapping.xml.types.BindXmlAutoNamingType.class,
143: "_autoNaming", "auto-naming",
144: org.exolab.castor.xml.NodeType.Attribute);
145: handler = new org.exolab.castor.xml.XMLFieldHandler() {
146: public java.lang.Object getValue(java.lang.Object object)
147: throws IllegalStateException {
148: BindXml target = (BindXml) object;
149: return target.getAutoNaming();
150: }
151:
152: public void setValue(java.lang.Object object,
153: java.lang.Object value)
154: throws IllegalStateException,
155: IllegalArgumentException {
156: try {
157: BindXml target = (BindXml) object;
158: target
159: .setAutoNaming((org.exolab.castor.mapping.xml.types.BindXmlAutoNamingType) value);
160: } catch (java.lang.Exception ex) {
161: throw new IllegalStateException(ex.toString());
162: }
163: }
164:
165: public java.lang.Object newInstance(java.lang.Object parent) {
166: return null;
167: }
168: };
169: handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
170: org.exolab.castor.mapping.xml.types.BindXmlAutoNamingType.class,
171: handler);
172: desc.setImmutable(true);
173: desc.setHandler(handler);
174: desc.setMultivalued(false);
175: addFieldDescriptor(desc);
176:
177: //-- validation code for: _autoNaming
178: fieldValidator = new org.exolab.castor.xml.FieldValidator();
179: { //-- local scope
180: }
181: desc.setValidator(fieldValidator);
182: //-- _location
183: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
184: java.lang.String.class, "_location", "location",
185: org.exolab.castor.xml.NodeType.Attribute);
186: desc.setImmutable(true);
187: handler = new org.exolab.castor.xml.XMLFieldHandler() {
188: public java.lang.Object getValue(java.lang.Object object)
189: throws IllegalStateException {
190: BindXml target = (BindXml) object;
191: return target.getLocation();
192: }
193:
194: public void setValue(java.lang.Object object,
195: java.lang.Object value)
196: throws IllegalStateException,
197: IllegalArgumentException {
198: try {
199: BindXml target = (BindXml) object;
200: target.setLocation((java.lang.String) value);
201: } catch (java.lang.Exception ex) {
202: throw new IllegalStateException(ex.toString());
203: }
204: }
205:
206: public java.lang.Object newInstance(java.lang.Object parent) {
207: return null;
208: }
209: };
210: desc.setHandler(handler);
211: desc.setMultivalued(false);
212: addFieldDescriptor(desc);
213:
214: //-- validation code for: _location
215: fieldValidator = new org.exolab.castor.xml.FieldValidator();
216: { //-- local scope
217: org.exolab.castor.xml.validators.StringValidator typeValidator = new org.exolab.castor.xml.validators.StringValidator();
218: typeValidator.setWhiteSpace("preserve");
219: fieldValidator.setValidator(typeValidator);
220: }
221: desc.setValidator(fieldValidator);
222: //-- _matches
223: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
224: java.lang.String.class, "_matches", "matches",
225: org.exolab.castor.xml.NodeType.Attribute);
226: desc.setImmutable(true);
227: handler = new org.exolab.castor.xml.XMLFieldHandler() {
228: public java.lang.Object getValue(java.lang.Object object)
229: throws IllegalStateException {
230: BindXml target = (BindXml) object;
231: return target.getMatches();
232: }
233:
234: public void setValue(java.lang.Object object,
235: java.lang.Object value)
236: throws IllegalStateException,
237: IllegalArgumentException {
238: try {
239: BindXml target = (BindXml) object;
240: target.setMatches((java.lang.String) value);
241: } catch (java.lang.Exception ex) {
242: throw new IllegalStateException(ex.toString());
243: }
244: }
245:
246: public java.lang.Object newInstance(java.lang.Object parent) {
247: return null;
248: }
249: };
250: desc.setHandler(handler);
251: desc.setMultivalued(false);
252: addFieldDescriptor(desc);
253:
254: //-- validation code for: _matches
255: fieldValidator = new org.exolab.castor.xml.FieldValidator();
256: { //-- local scope
257: org.exolab.castor.xml.validators.StringValidator typeValidator = new org.exolab.castor.xml.validators.StringValidator();
258: typeValidator.setWhiteSpace("preserve");
259: fieldValidator.setValidator(typeValidator);
260: }
261: desc.setValidator(fieldValidator);
262: //-- _reference
263: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
264: java.lang.Boolean.TYPE, "_reference", "reference",
265: org.exolab.castor.xml.NodeType.Attribute);
266: handler = new org.exolab.castor.xml.XMLFieldHandler() {
267: public java.lang.Object getValue(java.lang.Object object)
268: throws IllegalStateException {
269: BindXml target = (BindXml) object;
270: if (!target.hasReference())
271: return null;
272: return (target.getReference() ? java.lang.Boolean.TRUE
273: : java.lang.Boolean.FALSE);
274: }
275:
276: public void setValue(java.lang.Object object,
277: java.lang.Object value)
278: throws IllegalStateException,
279: IllegalArgumentException {
280: try {
281: BindXml target = (BindXml) object;
282: // if null, use delete method for optional primitives
283: if (value == null) {
284: target.deleteReference();
285: return;
286: }
287: target.setReference(((java.lang.Boolean) value)
288: .booleanValue());
289: } catch (java.lang.Exception ex) {
290: throw new IllegalStateException(ex.toString());
291: }
292: }
293:
294: public java.lang.Object newInstance(java.lang.Object parent) {
295: return null;
296: }
297: };
298: desc.setHandler(handler);
299: desc.setMultivalued(false);
300: addFieldDescriptor(desc);
301:
302: //-- validation code for: _reference
303: fieldValidator = new org.exolab.castor.xml.FieldValidator();
304: { //-- local scope
305: org.exolab.castor.xml.validators.BooleanValidator typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
306: fieldValidator.setValidator(typeValidator);
307: }
308: desc.setValidator(fieldValidator);
309: //-- _node
310: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
311: org.exolab.castor.mapping.xml.types.BindXmlNodeType.class,
312: "_node", "node",
313: org.exolab.castor.xml.NodeType.Attribute);
314: handler = new org.exolab.castor.xml.XMLFieldHandler() {
315: public java.lang.Object getValue(java.lang.Object object)
316: throws IllegalStateException {
317: BindXml target = (BindXml) object;
318: return target.getNode();
319: }
320:
321: public void setValue(java.lang.Object object,
322: java.lang.Object value)
323: throws IllegalStateException,
324: IllegalArgumentException {
325: try {
326: BindXml target = (BindXml) object;
327: target
328: .setNode((org.exolab.castor.mapping.xml.types.BindXmlNodeType) value);
329: } catch (java.lang.Exception ex) {
330: throw new IllegalStateException(ex.toString());
331: }
332: }
333:
334: public java.lang.Object newInstance(java.lang.Object parent) {
335: return null;
336: }
337: };
338: handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
339: org.exolab.castor.mapping.xml.types.BindXmlNodeType.class,
340: handler);
341: desc.setImmutable(true);
342: desc.setHandler(handler);
343: desc.setMultivalued(false);
344: addFieldDescriptor(desc);
345:
346: //-- validation code for: _node
347: fieldValidator = new org.exolab.castor.xml.FieldValidator();
348: { //-- local scope
349: }
350: desc.setValidator(fieldValidator);
351: //-- _QNamePrefix
352: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
353: java.lang.String.class, "_QNamePrefix", "QName-prefix",
354: org.exolab.castor.xml.NodeType.Attribute);
355: handler = new org.exolab.castor.xml.XMLFieldHandler() {
356: public java.lang.Object getValue(java.lang.Object object)
357: throws IllegalStateException {
358: BindXml target = (BindXml) object;
359: return target.getQNamePrefix();
360: }
361:
362: public void setValue(java.lang.Object object,
363: java.lang.Object value)
364: throws IllegalStateException,
365: IllegalArgumentException {
366: try {
367: BindXml target = (BindXml) object;
368: target.setQNamePrefix((java.lang.String) value);
369: } catch (java.lang.Exception ex) {
370: throw new IllegalStateException(ex.toString());
371: }
372: }
373:
374: public java.lang.Object newInstance(java.lang.Object parent) {
375: return new java.lang.String();
376: }
377: };
378: desc.setHandler(handler);
379: desc.setMultivalued(false);
380: addFieldDescriptor(desc);
381:
382: //-- validation code for: _QNamePrefix
383: fieldValidator = new org.exolab.castor.xml.FieldValidator();
384: { //-- local scope
385: org.exolab.castor.xml.validators.NameValidator typeValidator = new org.exolab.castor.xml.validators.NameValidator(
386: org.exolab.castor.xml.validators.NameValidator.NMTOKEN);
387: fieldValidator.setValidator(typeValidator);
388: }
389: desc.setValidator(fieldValidator);
390: //-- _transient
391: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
392: java.lang.Boolean.TYPE, "_transient", "transient",
393: org.exolab.castor.xml.NodeType.Attribute);
394: handler = new org.exolab.castor.xml.XMLFieldHandler() {
395: public java.lang.Object getValue(java.lang.Object object)
396: throws IllegalStateException {
397: BindXml target = (BindXml) object;
398: if (!target.hasTransient())
399: return null;
400: return (target.getTransient() ? java.lang.Boolean.TRUE
401: : java.lang.Boolean.FALSE);
402: }
403:
404: public void setValue(java.lang.Object object,
405: java.lang.Object value)
406: throws IllegalStateException,
407: IllegalArgumentException {
408: try {
409: BindXml target = (BindXml) object;
410: // if null, use delete method for optional primitives
411: if (value == null) {
412: target.deleteTransient();
413: return;
414: }
415: target.setTransient(((java.lang.Boolean) value)
416: .booleanValue());
417: } catch (java.lang.Exception ex) {
418: throw new IllegalStateException(ex.toString());
419: }
420: }
421:
422: public java.lang.Object newInstance(java.lang.Object parent) {
423: return null;
424: }
425: };
426: desc.setHandler(handler);
427: desc.setMultivalued(false);
428: addFieldDescriptor(desc);
429:
430: //-- validation code for: _transient
431: fieldValidator = new org.exolab.castor.xml.FieldValidator();
432: { //-- local scope
433: org.exolab.castor.xml.validators.BooleanValidator typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
434: fieldValidator.setValidator(typeValidator);
435: }
436: desc.setValidator(fieldValidator);
437: //-- initialize element descriptors
438:
439: //-- _classMapping
440: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
441: org.exolab.castor.mapping.xml.ClassMapping.class,
442: "_classMapping", "class",
443: org.exolab.castor.xml.NodeType.Element);
444: handler = new org.exolab.castor.xml.XMLFieldHandler() {
445: public java.lang.Object getValue(java.lang.Object object)
446: throws IllegalStateException {
447: BindXml target = (BindXml) object;
448: return target.getClassMapping();
449: }
450:
451: public void setValue(java.lang.Object object,
452: java.lang.Object value)
453: throws IllegalStateException,
454: IllegalArgumentException {
455: try {
456: BindXml target = (BindXml) object;
457: target
458: .setClassMapping((org.exolab.castor.mapping.xml.ClassMapping) value);
459: } catch (java.lang.Exception ex) {
460: throw new IllegalStateException(ex.toString());
461: }
462: }
463:
464: public java.lang.Object newInstance(java.lang.Object parent) {
465: return new org.exolab.castor.mapping.xml.ClassMapping();
466: }
467: };
468: desc.setHandler(handler);
469: desc.setNameSpaceURI("http://castor.exolab.org/");
470: desc.setMultivalued(false);
471: addFieldDescriptor(desc);
472:
473: //-- validation code for: _classMapping
474: fieldValidator = new org.exolab.castor.xml.FieldValidator();
475: { //-- local scope
476: }
477: desc.setValidator(fieldValidator);
478: //-- _propertyList
479: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
480: org.exolab.castor.mapping.xml.Property.class,
481: "_propertyList", "property",
482: org.exolab.castor.xml.NodeType.Element);
483: handler = new org.exolab.castor.xml.XMLFieldHandler() {
484: public java.lang.Object getValue(java.lang.Object object)
485: throws IllegalStateException {
486: BindXml target = (BindXml) object;
487: return target.getProperty();
488: }
489:
490: public void setValue(java.lang.Object object,
491: java.lang.Object value)
492: throws IllegalStateException,
493: IllegalArgumentException {
494: try {
495: BindXml target = (BindXml) object;
496: target
497: .addProperty((org.exolab.castor.mapping.xml.Property) value);
498: } catch (java.lang.Exception ex) {
499: throw new IllegalStateException(ex.toString());
500: }
501: }
502:
503: public java.lang.Object newInstance(java.lang.Object parent) {
504: return new org.exolab.castor.mapping.xml.Property();
505: }
506: };
507: desc.setHandler(handler);
508: desc.setMultivalued(true);
509: addFieldDescriptor(desc);
510:
511: //-- validation code for: _propertyList
512: fieldValidator = new org.exolab.castor.xml.FieldValidator();
513: fieldValidator.setMinOccurs(0);
514: { //-- local scope
515: }
516: desc.setValidator(fieldValidator);
517: } //-- org.exolab.castor.mapping.xml.BindXmlDescriptor()
518:
519: //-----------/
520: //- Methods -/
521: //-----------/
522:
523: /**
524: * Method getAccessMode
525: *
526: *
527: *
528: * @return AccessMode
529: */
530: public org.exolab.castor.mapping.AccessMode getAccessMode() {
531: return null;
532: } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
533:
534: /**
535: * Method getExtends
536: *
537: *
538: *
539: * @return ClassDescriptor
540: */
541: public org.exolab.castor.mapping.ClassDescriptor getExtends() {
542: return null;
543: } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
544:
545: /**
546: * Method getIdentity
547: *
548: *
549: *
550: * @return FieldDescriptor
551: */
552: public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
553: return identity;
554: } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
555:
556: /**
557: * Method getJavaClass
558: *
559: *
560: *
561: * @return Class
562: */
563: public java.lang.Class getJavaClass() {
564: return org.exolab.castor.mapping.xml.BindXml.class;
565: } //-- java.lang.Class getJavaClass()
566:
567: /**
568: * Method getNameSpacePrefix
569: *
570: *
571: *
572: * @return String
573: */
574: public java.lang.String getNameSpacePrefix() {
575: return nsPrefix;
576: } //-- java.lang.String getNameSpacePrefix()
577:
578: /**
579: * Method getNameSpaceURI
580: *
581: *
582: *
583: * @return String
584: */
585: public java.lang.String getNameSpaceURI() {
586: return nsURI;
587: } //-- java.lang.String getNameSpaceURI()
588:
589: /**
590: * Method getValidator
591: *
592: *
593: *
594: * @return TypeValidator
595: */
596: public org.exolab.castor.xml.TypeValidator getValidator() {
597: return this ;
598: } //-- org.exolab.castor.xml.TypeValidator getValidator()
599:
600: /**
601: * Method getXMLName
602: *
603: *
604: *
605: * @return String
606: */
607: public java.lang.String getXMLName() {
608: return xmlName;
609: } //-- java.lang.String getXMLName()
610:
611: /**
612: * Method isElementDefinition
613: *
614: *
615: *
616: * @return boolean
617: */
618: public boolean isElementDefinition() {
619: return elementDefinition;
620: } //-- boolean isElementDefinition()
621:
622: }
|