KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > reportdefinitions > MetricDefinitionDescriptor


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4  * Schema.
5  * $Id$
6  */

7
8 package com.calipso.reportgenerator.reportdefinitions;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import org.exolab.castor.mapping.AccessMode;
15 import org.exolab.castor.xml.TypeValidator;
16 import org.exolab.castor.xml.XMLFieldDescriptor;
17 import org.exolab.castor.xml.validators.*;
18
19 /**
20  * Class MetricDefinitionDescriptor.
21  *
22  * @version $Revision$ $Date$
23  */

24 public class MetricDefinitionDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
25
26
27       //--------------------------/
28
//- Class/Member Variables -/
29
//--------------------------/
30

31     /**
32      * Field nsPrefix
33      */

34     private java.lang.String JavaDoc nsPrefix;
35
36     /**
37      * Field nsURI
38      */

39     private java.lang.String JavaDoc nsURI;
40
41     /**
42      * Field xmlName
43      */

44     private java.lang.String JavaDoc xmlName;
45
46     /**
47      * Field identity
48      */

49     private org.exolab.castor.xml.XMLFieldDescriptor identity;
50
51
52       //----------------/
53
//- Constructors -/
54
//----------------/
55

56     public MetricDefinitionDescriptor() {
57         super();
58         xmlName = "MetricDefinition";
59         org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
60         org.exolab.castor.xml.XMLFieldHandler handler = null;
61         org.exolab.castor.xml.FieldValidator fieldValidator = null;
62         //-- initialize attribute descriptors
63

64         //-- _name
65
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_name", "Name", org.exolab.castor.xml.NodeType.Attribute);
66         desc.setImmutable(true);
67         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
68             public java.lang.Object JavaDoc getValue( java.lang.Object JavaDoc object )
69                 throws IllegalStateException JavaDoc
70             {
71                 MetricDefinition target = (MetricDefinition) object;
72                 return target.getName();
73             }
74             public void setValue( java.lang.Object JavaDoc object, java.lang.Object JavaDoc value)
75                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
76             {
77                 try {
78                     MetricDefinition target = (MetricDefinition) object;
79                     target.setName( (java.lang.String JavaDoc) value);
80                 }
81                 catch (java.lang.Exception JavaDoc ex) {
82                     throw new IllegalStateException JavaDoc(ex.toString());
83                 }
84             }
85             public java.lang.Object JavaDoc newInstance( java.lang.Object JavaDoc parent ) {
86                 return null;
87             }
88         } );
89         desc.setHandler(handler);
90         desc.setRequired(true);
91         addFieldDescriptor(desc);
92         
93         //-- validation code for: _name
94
fieldValidator = new org.exolab.castor.xml.FieldValidator();
95         fieldValidator.setMinOccurs(1);
96         { //-- local scope
97
StringValidator typeValidator = new StringValidator();
98             typeValidator.setWhiteSpace("preserve");
99             fieldValidator.setValidator(typeValidator);
100         }
101         desc.setValidator(fieldValidator);
102         //-- _description
103
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_description", "Description", org.exolab.castor.xml.NodeType.Attribute);
104         desc.setImmutable(true);
105         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
106             public java.lang.Object JavaDoc getValue( java.lang.Object JavaDoc object )
107                 throws IllegalStateException JavaDoc
108             {
109                 MetricDefinition target = (MetricDefinition) object;
110                 return target.getDescription();
111             }
112             public void setValue( java.lang.Object JavaDoc object, java.lang.Object JavaDoc value)
113                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
114             {
115                 try {
116                     MetricDefinition target = (MetricDefinition) object;
117                     target.setDescription( (java.lang.String JavaDoc) value);
118                 }
119                 catch (java.lang.Exception JavaDoc ex) {
120                     throw new IllegalStateException JavaDoc(ex.toString());
121                 }
122             }
123             public java.lang.Object JavaDoc newInstance( java.lang.Object JavaDoc parent ) {
124                 return null;
125             }
126         } );
127         desc.setHandler(handler);
128         addFieldDescriptor(desc);
129         
130         //-- validation code for: _description
131
fieldValidator = new org.exolab.castor.xml.FieldValidator();
132         { //-- local scope
133
StringValidator typeValidator = new StringValidator();
134             typeValidator.setWhiteSpace("preserve");
135             fieldValidator.setValidator(typeValidator);
136         }
137         desc.setValidator(fieldValidator);
138         //-- _visible
139
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_visible", "Visible", org.exolab.castor.xml.NodeType.Attribute);
140         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
141             public java.lang.Object JavaDoc getValue( java.lang.Object JavaDoc object )
142                 throws IllegalStateException JavaDoc
143             {
144                 MetricDefinition target = (MetricDefinition) object;
145                 if(!target.hasVisible())
146                     return null;
147                 return new Boolean JavaDoc(target.getVisible());
148             }
149             public void setValue( java.lang.Object JavaDoc object, java.lang.Object JavaDoc value)
150                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
151             {
152                 try {
153                     MetricDefinition target = (MetricDefinition) object;
154                     // ignore null values for non optional primitives
155
if (value == null) return;
156                     
157                     target.setVisible( ((Boolean JavaDoc)value).booleanValue());
158                 }
159                 catch (java.lang.Exception JavaDoc ex) {
160                     throw new IllegalStateException JavaDoc(ex.toString());
161                 }
162             }
163             public java.lang.Object JavaDoc newInstance( java.lang.Object JavaDoc parent ) {
164                 return null;
165             }
166         } );
167         desc.setHandler(handler);
168         desc.setRequired(true);
169         addFieldDescriptor(desc);
170         
171         //-- validation code for: _visible
172
fieldValidator = new org.exolab.castor.xml.FieldValidator();
173         fieldValidator.setMinOccurs(1);
174         { //-- local scope
175
BooleanValidator typeValidator = new BooleanValidator();
176             fieldValidator.setValidator(typeValidator);
177         }
178         desc.setValidator(fieldValidator);
179         //-- _accumulable
180
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_accumulable", "Accumulable", org.exolab.castor.xml.NodeType.Attribute);
181         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
182             public java.lang.Object JavaDoc getValue( java.lang.Object JavaDoc object )
183                 throws IllegalStateException JavaDoc
184             {
185                 MetricDefinition target = (MetricDefinition) object;
186                 if(!target.hasAccumulable())
187                     return null;
188                 return new Boolean JavaDoc(target.getAccumulable());
189             }
190             public void setValue( java.lang.Object JavaDoc object, java.lang.Object JavaDoc value)
191                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
192             {
193                 try {
194                     MetricDefinition target = (MetricDefinition) object;
195                     // if null, use delete method for optional primitives
196
if (value == null) {
197                         target.deleteAccumulable();
198                         return;
199                     }
200                     target.setAccumulable( ((Boolean JavaDoc)value).booleanValue());
201                 }
202                 catch (java.lang.Exception JavaDoc ex) {
203                     throw new IllegalStateException JavaDoc(ex.toString());
204                 }
205             }
206             public java.lang.Object JavaDoc newInstance( java.lang.Object JavaDoc parent ) {
207                 return null;
208             }
209         } );
210         desc.setHandler(handler);
211         addFieldDescriptor(desc);
212         
213         //-- validation code for: _accumulable
214
fieldValidator = new org.exolab.castor.xml.FieldValidator();
215         { //-- local scope
216
BooleanValidator typeValidator = new BooleanValidator();
217             fieldValidator.setValidator(typeValidator);
218         }
219         desc.setValidator(fieldValidator);
220         //-- initialize element descriptors
221

222     } //-- com.calipso.reportgenerator.reportdefinitions.MetricDefinitionDescriptor()
223

224
225       //-----------/
226
//- Methods -/
227
//-----------/
228

229     /**
230      * Method getAccessMode
231      */

232     public org.exolab.castor.mapping.AccessMode getAccessMode()
233     {
234         return null;
235     } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
236

237     /**
238      * Method getExtends
239      */

240     public org.exolab.castor.mapping.ClassDescriptor getExtends()
241     {
242         return null;
243     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
244

245     /**
246      * Method getIdentity
247      */

248     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
249     {
250         return identity;
251     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
252

253     /**
254      * Method getJavaClass
255      */

256     public java.lang.Class JavaDoc getJavaClass()
257     {
258         return com.calipso.reportgenerator.reportdefinitions.MetricDefinition.class;
259     } //-- java.lang.Class getJavaClass()
260

261     /**
262      * Method getNameSpacePrefix
263      */

264     public java.lang.String JavaDoc getNameSpacePrefix()
265     {
266         return nsPrefix;
267     } //-- java.lang.String getNameSpacePrefix()
268

269     /**
270      * Method getNameSpaceURI
271      */

272     public java.lang.String JavaDoc getNameSpaceURI()
273     {
274         return nsURI;
275     } //-- java.lang.String getNameSpaceURI()
276

277     /**
278      * Method getValidator
279      */

280     public org.exolab.castor.xml.TypeValidator getValidator()
281     {
282         return this;
283     } //-- org.exolab.castor.xml.TypeValidator getValidator()
284

285     /**
286      * Method getXMLName
287      */

288     public java.lang.String JavaDoc getXMLName()
289     {
290         return xmlName;
291     } //-- java.lang.String getXMLName()
292

293 }
294
Popular Tags