001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
004: * Schema.
005: * $Id$
006: */
007:
008: package com.calipso.reportgenerator.reportdefinitions;
009:
010: //---------------------------------/
011: //- Imported classes and packages -/
012: //---------------------------------/
013:
014: import org.exolab.castor.mapping.AccessMode;
015: import org.exolab.castor.xml.TypeValidator;
016: import org.exolab.castor.xml.XMLFieldDescriptor;
017: import org.exolab.castor.xml.validators.*;
018:
019: /**
020: * Class DimensionPropertyDescriptor.
021: *
022: * @version $Revision$ $Date$
023: */
024: public class DimensionPropertyDescriptor extends
025: org.exolab.castor.xml.util.XMLClassDescriptorImpl {
026:
027: //--------------------------/
028: //- Class/Member Variables -/
029: //--------------------------/
030:
031: /**
032: * Field nsPrefix
033: */
034: private java.lang.String nsPrefix;
035:
036: /**
037: * Field nsURI
038: */
039: private java.lang.String nsURI;
040:
041: /**
042: * Field xmlName
043: */
044: private java.lang.String xmlName;
045:
046: /**
047: * Field identity
048: */
049: private org.exolab.castor.xml.XMLFieldDescriptor identity;
050:
051: //----------------/
052: //- Constructors -/
053: //----------------/
054:
055: public DimensionPropertyDescriptor() {
056: super ();
057: xmlName = "DimensionProperty";
058:
059: //-- set grouping compositor
060: setCompositorAsSequence();
061: org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
062: org.exolab.castor.xml.XMLFieldHandler handler = null;
063: org.exolab.castor.xml.FieldValidator fieldValidator = null;
064: //-- initialize attribute descriptors
065:
066: //-- _dimensionName
067: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
068: java.lang.String.class, "_dimensionName",
069: "DimensionName",
070: org.exolab.castor.xml.NodeType.Attribute);
071: desc.setImmutable(true);
072: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
073: public java.lang.Object getValue(java.lang.Object object)
074: throws IllegalStateException {
075: DimensionProperty target = (DimensionProperty) object;
076: return target.getDimensionName();
077: }
078:
079: public void setValue(java.lang.Object object,
080: java.lang.Object value)
081: throws IllegalStateException,
082: IllegalArgumentException {
083: try {
084: DimensionProperty target = (DimensionProperty) object;
085: target.setDimensionName((java.lang.String) value);
086: } catch (java.lang.Exception ex) {
087: throw new IllegalStateException(ex.toString());
088: }
089: }
090:
091: public java.lang.Object newInstance(java.lang.Object parent) {
092: return null;
093: }
094: });
095: desc.setHandler(handler);
096: desc.setRequired(true);
097: addFieldDescriptor(desc);
098:
099: //-- validation code for: _dimensionName
100: fieldValidator = new org.exolab.castor.xml.FieldValidator();
101: fieldValidator.setMinOccurs(1);
102: { //-- local scope
103: StringValidator typeValidator = new StringValidator();
104: typeValidator.setWhiteSpace("preserve");
105: fieldValidator.setValidator(typeValidator);
106: }
107: desc.setValidator(fieldValidator);
108: //-- _width
109: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
110: java.lang.Integer.TYPE, "_width", "Width",
111: org.exolab.castor.xml.NodeType.Attribute);
112: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
113: public java.lang.Object getValue(java.lang.Object object)
114: throws IllegalStateException {
115: DimensionProperty target = (DimensionProperty) object;
116: if (!target.hasWidth())
117: return null;
118: return new Integer(target.getWidth());
119: }
120:
121: public void setValue(java.lang.Object object,
122: java.lang.Object value)
123: throws IllegalStateException,
124: IllegalArgumentException {
125: try {
126: DimensionProperty target = (DimensionProperty) object;
127: // if null, use delete method for optional primitives
128: if (value == null) {
129: target.deleteWidth();
130: return;
131: }
132: target.setWidth(((Integer) value).intValue());
133: } catch (java.lang.Exception ex) {
134: throw new IllegalStateException(ex.toString());
135: }
136: }
137:
138: public java.lang.Object newInstance(java.lang.Object parent) {
139: return null;
140: }
141: });
142: desc.setHandler(handler);
143: addFieldDescriptor(desc);
144:
145: //-- validation code for: _width
146: fieldValidator = new org.exolab.castor.xml.FieldValidator();
147: { //-- local scope
148: IntegerValidator typeValidator = new IntegerValidator();
149: fieldValidator.setValidator(typeValidator);
150: }
151: desc.setValidator(fieldValidator);
152: //-- _location
153: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
154: com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType.class,
155: "_location", "Location",
156: org.exolab.castor.xml.NodeType.Attribute);
157: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
158: public java.lang.Object getValue(java.lang.Object object)
159: throws IllegalStateException {
160: DimensionProperty target = (DimensionProperty) object;
161: return target.getLocation();
162: }
163:
164: public void setValue(java.lang.Object object,
165: java.lang.Object value)
166: throws IllegalStateException,
167: IllegalArgumentException {
168: try {
169: DimensionProperty target = (DimensionProperty) object;
170: target
171: .setLocation((com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType) value);
172: } catch (java.lang.Exception ex) {
173: throw new IllegalStateException(ex.toString());
174: }
175: }
176:
177: public java.lang.Object newInstance(java.lang.Object parent) {
178: return null;
179: }
180: });
181: desc
182: .setHandler(new org.exolab.castor.xml.handlers.EnumFieldHandler(
183: com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType.class,
184: handler));
185: desc.setImmutable(true);
186: desc.setRequired(true);
187: addFieldDescriptor(desc);
188:
189: //-- validation code for: _location
190: fieldValidator = new org.exolab.castor.xml.FieldValidator();
191: fieldValidator.setMinOccurs(1);
192: { //-- local scope
193: }
194: desc.setValidator(fieldValidator);
195: //-- _order
196: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
197: com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType.class,
198: "_order", "Order",
199: org.exolab.castor.xml.NodeType.Attribute);
200: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
201: public java.lang.Object getValue(java.lang.Object object)
202: throws IllegalStateException {
203: DimensionProperty target = (DimensionProperty) object;
204: return target.getOrder();
205: }
206:
207: public void setValue(java.lang.Object object,
208: java.lang.Object value)
209: throws IllegalStateException,
210: IllegalArgumentException {
211: try {
212: DimensionProperty target = (DimensionProperty) object;
213: target
214: .setOrder((com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType) value);
215: } catch (java.lang.Exception ex) {
216: throw new IllegalStateException(ex.toString());
217: }
218: }
219:
220: public java.lang.Object newInstance(java.lang.Object parent) {
221: return null;
222: }
223: });
224: desc
225: .setHandler(new org.exolab.castor.xml.handlers.EnumFieldHandler(
226: com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType.class,
227: handler));
228: desc.setImmutable(true);
229: addFieldDescriptor(desc);
230:
231: //-- validation code for: _order
232: fieldValidator = new org.exolab.castor.xml.FieldValidator();
233: { //-- local scope
234: }
235: desc.setValidator(fieldValidator);
236: //-- _ubication
237: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
238: java.lang.Integer.TYPE, "_ubication", "Ubication",
239: org.exolab.castor.xml.NodeType.Attribute);
240: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
241: public java.lang.Object getValue(java.lang.Object object)
242: throws IllegalStateException {
243: DimensionProperty target = (DimensionProperty) object;
244: if (!target.hasUbication())
245: return null;
246: return new Integer(target.getUbication());
247: }
248:
249: public void setValue(java.lang.Object object,
250: java.lang.Object value)
251: throws IllegalStateException,
252: IllegalArgumentException {
253: try {
254: DimensionProperty target = (DimensionProperty) object;
255: // if null, use delete method for optional primitives
256: if (value == null) {
257: target.deleteUbication();
258: return;
259: }
260: target.setUbication(((Integer) value).intValue());
261: } catch (java.lang.Exception ex) {
262: throw new IllegalStateException(ex.toString());
263: }
264: }
265:
266: public java.lang.Object newInstance(java.lang.Object parent) {
267: return null;
268: }
269: });
270: desc.setHandler(handler);
271: addFieldDescriptor(desc);
272:
273: //-- validation code for: _ubication
274: fieldValidator = new org.exolab.castor.xml.FieldValidator();
275: { //-- local scope
276: IntegerValidator typeValidator = new IntegerValidator();
277: fieldValidator.setValidator(typeValidator);
278: }
279: desc.setValidator(fieldValidator);
280: //-- _rankMetricName
281: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
282: java.lang.String.class, "_rankMetricName",
283: "RankMetricName",
284: org.exolab.castor.xml.NodeType.Attribute);
285: desc.setImmutable(true);
286: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
287: public java.lang.Object getValue(java.lang.Object object)
288: throws IllegalStateException {
289: DimensionProperty target = (DimensionProperty) object;
290: return target.getRankMetricName();
291: }
292:
293: public void setValue(java.lang.Object object,
294: java.lang.Object value)
295: throws IllegalStateException,
296: IllegalArgumentException {
297: try {
298: DimensionProperty target = (DimensionProperty) object;
299: target.setRankMetricName((java.lang.String) value);
300: } catch (java.lang.Exception ex) {
301: throw new IllegalStateException(ex.toString());
302: }
303: }
304:
305: public java.lang.Object newInstance(java.lang.Object parent) {
306: return null;
307: }
308: });
309: desc.setHandler(handler);
310: addFieldDescriptor(desc);
311:
312: //-- validation code for: _rankMetricName
313: fieldValidator = new org.exolab.castor.xml.FieldValidator();
314: { //-- local scope
315: StringValidator typeValidator = new StringValidator();
316: typeValidator.setWhiteSpace("preserve");
317: fieldValidator.setValidator(typeValidator);
318: }
319: desc.setValidator(fieldValidator);
320: //-- initialize element descriptors
321:
322: //-- _excludeValueList
323: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
324: com.calipso.reportgenerator.reportdefinitions.ExcludeValue.class,
325: "_excludeValueList", "ExcludeValue",
326: org.exolab.castor.xml.NodeType.Element);
327: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
328: public java.lang.Object getValue(java.lang.Object object)
329: throws IllegalStateException {
330: DimensionProperty target = (DimensionProperty) object;
331: return target.getExcludeValue();
332: }
333:
334: public void setValue(java.lang.Object object,
335: java.lang.Object value)
336: throws IllegalStateException,
337: IllegalArgumentException {
338: try {
339: DimensionProperty target = (DimensionProperty) object;
340: target
341: .addExcludeValue((com.calipso.reportgenerator.reportdefinitions.ExcludeValue) value);
342: } catch (java.lang.Exception ex) {
343: throw new IllegalStateException(ex.toString());
344: }
345: }
346:
347: public java.lang.Object newInstance(java.lang.Object parent) {
348: return new com.calipso.reportgenerator.reportdefinitions.ExcludeValue();
349: }
350: });
351: desc.setHandler(handler);
352: desc.setMultivalued(true);
353: addFieldDescriptor(desc);
354:
355: //-- validation code for: _excludeValueList
356: fieldValidator = new org.exolab.castor.xml.FieldValidator();
357: fieldValidator.setMinOccurs(0);
358: { //-- local scope
359: }
360: desc.setValidator(fieldValidator);
361: } //-- com.calipso.reportgenerator.reportdefinitions.DimensionPropertyDescriptor()
362:
363: //-----------/
364: //- Methods -/
365: //-----------/
366:
367: /**
368: * Method getAccessMode
369: */
370: public org.exolab.castor.mapping.AccessMode getAccessMode() {
371: return null;
372: } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
373:
374: /**
375: * Method getExtends
376: */
377: public org.exolab.castor.mapping.ClassDescriptor getExtends() {
378: return null;
379: } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
380:
381: /**
382: * Method getIdentity
383: */
384: public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
385: return identity;
386: } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
387:
388: /**
389: * Method getJavaClass
390: */
391: public java.lang.Class getJavaClass() {
392: return com.calipso.reportgenerator.reportdefinitions.DimensionProperty.class;
393: } //-- java.lang.Class getJavaClass()
394:
395: /**
396: * Method getNameSpacePrefix
397: */
398: public java.lang.String getNameSpacePrefix() {
399: return nsPrefix;
400: } //-- java.lang.String getNameSpacePrefix()
401:
402: /**
403: * Method getNameSpaceURI
404: */
405: public java.lang.String getNameSpaceURI() {
406: return nsURI;
407: } //-- java.lang.String getNameSpaceURI()
408:
409: /**
410: * Method getValidator
411: */
412: public org.exolab.castor.xml.TypeValidator getValidator() {
413: return this ;
414: } //-- org.exolab.castor.xml.TypeValidator getValidator()
415:
416: /**
417: * Method getXMLName
418: */
419: public java.lang.String getXMLName() {
420: return xmlName;
421: } //-- java.lang.String getXMLName()
422:
423: }
|