KickJava   Java API By Example, From Geeks To Geeks.

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


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 MetricPropertyDescriptor.
21  *
22  * @version $Revision$ $Date$
23  */

24 public class MetricPropertyDescriptor 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 MetricPropertyDescriptor() {
57         super();
58         xmlName = "MetricProperty";
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         //-- _metricName
65
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String JavaDoc.class, "_metricName", "MetricName", 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                 MetricProperty target = (MetricProperty) object;
72                 return target.getMetricName();
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                     MetricProperty target = (MetricProperty) object;
79                     target.setMetricName( (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: _metricName
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         //-- _visible
103
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_visible", "Visible", org.exolab.castor.xml.NodeType.Attribute);
104         handler = (new org.exolab.castor.xml.XMLFieldHandler() {
105             public java.lang.Object JavaDoc getValue( java.lang.Object JavaDoc object )
106                 throws IllegalStateException JavaDoc
107             {
108                 MetricProperty target = (MetricProperty) object;
109                 if(!target.hasVisible())
110                     return null;
111                 return new Boolean JavaDoc(target.getVisible());
112             }
113             public void setValue( java.lang.Object JavaDoc object, java.lang.Object JavaDoc value)
114                 throws IllegalStateException JavaDoc, IllegalArgumentException JavaDoc
115             {
116                 try {
117                     MetricProperty target = (MetricProperty) object;
118                     // if null, use delete method for optional primitives
119
if (value == null) {
120                         target.deleteVisible();
121                         return;
122                     }
123                     target.setVisible( ((Boolean JavaDoc)value).booleanValue());
124                 }
125                 catch (java.lang.Exception JavaDoc ex) {
126                     throw new IllegalStateException JavaDoc(ex.toString());
127                 }
128             }
129             public java.lang.Object JavaDoc newInstance( java.lang.Object JavaDoc parent ) {
130                 return null;
131             }
132         } );
133         desc.setHandler(handler);
134         addFieldDescriptor(desc);
135         
136         //-- validation code for: _visible
137
fieldValidator = new org.exolab.castor.xml.FieldValidator();
138         { //-- local scope
139
BooleanValidator typeValidator = new BooleanValidator();
140             fieldValidator.setValidator(typeValidator);
141         }
142         desc.setValidator(fieldValidator);
143         //-- initialize element descriptors
144

145     } //-- com.calipso.reportgenerator.reportdefinitions.MetricPropertyDescriptor()
146

147
148       //-----------/
149
//- Methods -/
150
//-----------/
151

152     /**
153      * Method getAccessMode
154      */

155     public org.exolab.castor.mapping.AccessMode getAccessMode()
156     {
157         return null;
158     } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
159

160     /**
161      * Method getExtends
162      */

163     public org.exolab.castor.mapping.ClassDescriptor getExtends()
164     {
165         return null;
166     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
167

168     /**
169      * Method getIdentity
170      */

171     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
172     {
173         return identity;
174     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
175

176     /**
177      * Method getJavaClass
178      */

179     public java.lang.Class JavaDoc getJavaClass()
180     {
181         return com.calipso.reportgenerator.reportdefinitions.MetricProperty.class;
182     } //-- java.lang.Class getJavaClass()
183

184     /**
185      * Method getNameSpacePrefix
186      */

187     public java.lang.String JavaDoc getNameSpacePrefix()
188     {
189         return nsPrefix;
190     } //-- java.lang.String getNameSpacePrefix()
191

192     /**
193      * Method getNameSpaceURI
194      */

195     public java.lang.String JavaDoc getNameSpaceURI()
196     {
197         return nsURI;
198     } //-- java.lang.String getNameSpaceURI()
199

200     /**
201      * Method getValidator
202      */

203     public org.exolab.castor.xml.TypeValidator getValidator()
204     {
205         return this;
206     } //-- org.exolab.castor.xml.TypeValidator getValidator()
207

208     /**
209      * Method getXMLName
210      */

211     public java.lang.String JavaDoc getXMLName()
212     {
213         return xmlName;
214     } //-- java.lang.String getXMLName()
215

216 }
217
Popular Tags