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 MetricPropertyDescriptor.
021: *
022: * @version $Revision$ $Date$
023: */
024: public class MetricPropertyDescriptor 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 MetricPropertyDescriptor() {
056: super ();
057: xmlName = "MetricProperty";
058: org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
059: org.exolab.castor.xml.XMLFieldHandler handler = null;
060: org.exolab.castor.xml.FieldValidator fieldValidator = null;
061: //-- initialize attribute descriptors
062:
063: //-- _metricName
064: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
065: java.lang.String.class, "_metricName", "MetricName",
066: org.exolab.castor.xml.NodeType.Attribute);
067: desc.setImmutable(true);
068: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
069: public java.lang.Object getValue(java.lang.Object object)
070: throws IllegalStateException {
071: MetricProperty target = (MetricProperty) object;
072: return target.getMetricName();
073: }
074:
075: public void setValue(java.lang.Object object,
076: java.lang.Object value)
077: throws IllegalStateException,
078: IllegalArgumentException {
079: try {
080: MetricProperty target = (MetricProperty) object;
081: target.setMetricName((java.lang.String) value);
082: } catch (java.lang.Exception ex) {
083: throw new IllegalStateException(ex.toString());
084: }
085: }
086:
087: public java.lang.Object newInstance(java.lang.Object parent) {
088: return null;
089: }
090: });
091: desc.setHandler(handler);
092: desc.setRequired(true);
093: addFieldDescriptor(desc);
094:
095: //-- validation code for: _metricName
096: fieldValidator = new org.exolab.castor.xml.FieldValidator();
097: fieldValidator.setMinOccurs(1);
098: { //-- local scope
099: StringValidator typeValidator = new StringValidator();
100: typeValidator.setWhiteSpace("preserve");
101: fieldValidator.setValidator(typeValidator);
102: }
103: desc.setValidator(fieldValidator);
104: //-- _visible
105: desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
106: java.lang.Boolean.TYPE, "_visible", "Visible",
107: org.exolab.castor.xml.NodeType.Attribute);
108: handler = (new org.exolab.castor.xml.XMLFieldHandler() {
109: public java.lang.Object getValue(java.lang.Object object)
110: throws IllegalStateException {
111: MetricProperty target = (MetricProperty) object;
112: if (!target.hasVisible())
113: return null;
114: return new Boolean(target.getVisible());
115: }
116:
117: public void setValue(java.lang.Object object,
118: java.lang.Object value)
119: throws IllegalStateException,
120: IllegalArgumentException {
121: try {
122: MetricProperty target = (MetricProperty) object;
123: // if null, use delete method for optional primitives
124: if (value == null) {
125: target.deleteVisible();
126: return;
127: }
128: target.setVisible(((Boolean) value).booleanValue());
129: } catch (java.lang.Exception ex) {
130: throw new IllegalStateException(ex.toString());
131: }
132: }
133:
134: public java.lang.Object newInstance(java.lang.Object parent) {
135: return null;
136: }
137: });
138: desc.setHandler(handler);
139: addFieldDescriptor(desc);
140:
141: //-- validation code for: _visible
142: fieldValidator = new org.exolab.castor.xml.FieldValidator();
143: { //-- local scope
144: BooleanValidator typeValidator = new BooleanValidator();
145: fieldValidator.setValidator(typeValidator);
146: }
147: desc.setValidator(fieldValidator);
148: //-- initialize element descriptors
149:
150: } //-- com.calipso.reportgenerator.reportdefinitions.MetricPropertyDescriptor()
151:
152: //-----------/
153: //- Methods -/
154: //-----------/
155:
156: /**
157: * Method getAccessMode
158: */
159: public org.exolab.castor.mapping.AccessMode getAccessMode() {
160: return null;
161: } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
162:
163: /**
164: * Method getExtends
165: */
166: public org.exolab.castor.mapping.ClassDescriptor getExtends() {
167: return null;
168: } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
169:
170: /**
171: * Method getIdentity
172: */
173: public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
174: return identity;
175: } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
176:
177: /**
178: * Method getJavaClass
179: */
180: public java.lang.Class getJavaClass() {
181: return com.calipso.reportgenerator.reportdefinitions.MetricProperty.class;
182: } //-- java.lang.Class getJavaClass()
183:
184: /**
185: * Method getNameSpacePrefix
186: */
187: public java.lang.String getNameSpacePrefix() {
188: return nsPrefix;
189: } //-- java.lang.String getNameSpacePrefix()
190:
191: /**
192: * Method getNameSpaceURI
193: */
194: public java.lang.String getNameSpaceURI() {
195: return nsURI;
196: } //-- java.lang.String getNameSpaceURI()
197:
198: /**
199: * Method getValidator
200: */
201: public org.exolab.castor.xml.TypeValidator getValidator() {
202: return this ;
203: } //-- org.exolab.castor.xml.TypeValidator getValidator()
204:
205: /**
206: * Method getXMLName
207: */
208: public java.lang.String getXMLName() {
209: return xmlName;
210: } //-- java.lang.String getXMLName()
211:
212: }
|