1 7 8 package com.calipso.reportgenerator.reportdefinitions; 9 10 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 24 public class MetricDefinitionDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { 25 26 27 31 34 private java.lang.String nsPrefix; 35 36 39 private java.lang.String nsURI; 40 41 44 private java.lang.String xmlName; 45 46 49 private org.exolab.castor.xml.XMLFieldDescriptor identity; 50 51 52 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 64 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String .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 getValue( java.lang.Object object ) 69 throws IllegalStateException 70 { 71 MetricDefinition target = (MetricDefinition) object; 72 return target.getName(); 73 } 74 public void setValue( java.lang.Object object, java.lang.Object value) 75 throws IllegalStateException , IllegalArgumentException 76 { 77 try { 78 MetricDefinition target = (MetricDefinition) object; 79 target.setName( (java.lang.String ) value); 80 } 81 catch (java.lang.Exception ex) { 82 throw new IllegalStateException (ex.toString()); 83 } 84 } 85 public java.lang.Object newInstance( java.lang.Object parent ) { 86 return null; 87 } 88 } ); 89 desc.setHandler(handler); 90 desc.setRequired(true); 91 addFieldDescriptor(desc); 92 93 fieldValidator = new org.exolab.castor.xml.FieldValidator(); 95 fieldValidator.setMinOccurs(1); 96 { StringValidator typeValidator = new StringValidator(); 98 typeValidator.setWhiteSpace("preserve"); 99 fieldValidator.setValidator(typeValidator); 100 } 101 desc.setValidator(fieldValidator); 102 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String .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 getValue( java.lang.Object object ) 107 throws IllegalStateException 108 { 109 MetricDefinition target = (MetricDefinition) object; 110 return target.getDescription(); 111 } 112 public void setValue( java.lang.Object object, java.lang.Object value) 113 throws IllegalStateException , IllegalArgumentException 114 { 115 try { 116 MetricDefinition target = (MetricDefinition) object; 117 target.setDescription( (java.lang.String ) value); 118 } 119 catch (java.lang.Exception ex) { 120 throw new IllegalStateException (ex.toString()); 121 } 122 } 123 public java.lang.Object newInstance( java.lang.Object parent ) { 124 return null; 125 } 126 } ); 127 desc.setHandler(handler); 128 addFieldDescriptor(desc); 129 130 fieldValidator = new org.exolab.castor.xml.FieldValidator(); 132 { StringValidator typeValidator = new StringValidator(); 134 typeValidator.setWhiteSpace("preserve"); 135 fieldValidator.setValidator(typeValidator); 136 } 137 desc.setValidator(fieldValidator); 138 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 getValue( java.lang.Object object ) 142 throws IllegalStateException 143 { 144 MetricDefinition target = (MetricDefinition) object; 145 if(!target.hasVisible()) 146 return null; 147 return new Boolean (target.getVisible()); 148 } 149 public void setValue( java.lang.Object object, java.lang.Object value) 150 throws IllegalStateException , IllegalArgumentException 151 { 152 try { 153 MetricDefinition target = (MetricDefinition) object; 154 if (value == null) return; 156 157 target.setVisible( ((Boolean )value).booleanValue()); 158 } 159 catch (java.lang.Exception ex) { 160 throw new IllegalStateException (ex.toString()); 161 } 162 } 163 public java.lang.Object newInstance( java.lang.Object parent ) { 164 return null; 165 } 166 } ); 167 desc.setHandler(handler); 168 desc.setRequired(true); 169 addFieldDescriptor(desc); 170 171 fieldValidator = new org.exolab.castor.xml.FieldValidator(); 173 fieldValidator.setMinOccurs(1); 174 { BooleanValidator typeValidator = new BooleanValidator(); 176 fieldValidator.setValidator(typeValidator); 177 } 178 desc.setValidator(fieldValidator); 179 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 getValue( java.lang.Object object ) 183 throws IllegalStateException 184 { 185 MetricDefinition target = (MetricDefinition) object; 186 if(!target.hasAccumulable()) 187 return null; 188 return new Boolean (target.getAccumulable()); 189 } 190 public void setValue( java.lang.Object object, java.lang.Object value) 191 throws IllegalStateException , IllegalArgumentException 192 { 193 try { 194 MetricDefinition target = (MetricDefinition) object; 195 if (value == null) { 197 target.deleteAccumulable(); 198 return; 199 } 200 target.setAccumulable( ((Boolean )value).booleanValue()); 201 } 202 catch (java.lang.Exception ex) { 203 throw new IllegalStateException (ex.toString()); 204 } 205 } 206 public java.lang.Object newInstance( java.lang.Object parent ) { 207 return null; 208 } 209 } ); 210 desc.setHandler(handler); 211 addFieldDescriptor(desc); 212 213 fieldValidator = new org.exolab.castor.xml.FieldValidator(); 215 { BooleanValidator typeValidator = new BooleanValidator(); 217 fieldValidator.setValidator(typeValidator); 218 } 219 desc.setValidator(fieldValidator); 220 222 } 224 225 229 232 public org.exolab.castor.mapping.AccessMode getAccessMode() 233 { 234 return null; 235 } 237 240 public org.exolab.castor.mapping.ClassDescriptor getExtends() 241 { 242 return null; 243 } 245 248 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 249 { 250 return identity; 251 } 253 256 public java.lang.Class getJavaClass() 257 { 258 return com.calipso.reportgenerator.reportdefinitions.MetricDefinition.class; 259 } 261 264 public java.lang.String getNameSpacePrefix() 265 { 266 return nsPrefix; 267 } 269 272 public java.lang.String getNameSpaceURI() 273 { 274 return nsURI; 275 } 277 280 public org.exolab.castor.xml.TypeValidator getValidator() 281 { 282 return this; 283 } 285 288 public java.lang.String getXMLName() 289 { 290 return xmlName; 291 } 293 } 294 | Popular Tags |