1 7 8 package com.calipso.reportgenerator.reportdefinitions; 9 10 14 import com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType; 15 import com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType; 16 import java.io.IOException ; 17 import java.io.Reader ; 18 import java.io.Serializable ; 19 import java.io.Writer ; 20 import java.util.Enumeration ; 21 import java.util.Vector ; 22 import org.exolab.castor.xml.MarshalException; 23 import org.exolab.castor.xml.Marshaller; 24 import org.exolab.castor.xml.Unmarshaller; 25 import org.exolab.castor.xml.ValidationException; 26 import org.xml.sax.ContentHandler ; 27 28 33 public class DimensionProperty implements java.io.Serializable { 34 35 36 40 43 private java.lang.String _dimensionName; 44 45 48 private int _width; 49 50 53 private boolean _has_width; 54 55 58 private com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType _location; 59 60 63 private com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType _order; 64 65 68 private int _ubication; 69 70 73 private boolean _has_ubication; 74 75 78 private java.lang.String _rankMetricName; 79 80 83 private java.util.Vector _excludeValueList; 84 85 86 90 public DimensionProperty() { 91 super(); 92 _excludeValueList = new Vector (); 93 } 95 96 100 105 public void addExcludeValue(com.calipso.reportgenerator.reportdefinitions.ExcludeValue vExcludeValue) 106 throws java.lang.IndexOutOfBoundsException 107 { 108 _excludeValueList.addElement(vExcludeValue); 109 } 111 117 public void addExcludeValue(int index, com.calipso.reportgenerator.reportdefinitions.ExcludeValue vExcludeValue) 118 throws java.lang.IndexOutOfBoundsException 119 { 120 _excludeValueList.insertElementAt(vExcludeValue, index); 121 } 123 126 public void deleteUbication() 127 { 128 this._has_ubication= false; 129 } 131 134 public void deleteWidth() 135 { 136 this._has_width= false; 137 } 139 142 public java.util.Enumeration enumerateExcludeValue() 143 { 144 return _excludeValueList.elements(); 145 } 147 153 public java.lang.String getDimensionName() 154 { 155 return this._dimensionName; 156 } 158 163 public com.calipso.reportgenerator.reportdefinitions.ExcludeValue getExcludeValue(int index) 164 throws java.lang.IndexOutOfBoundsException 165 { 166 if ((index < 0) || (index > _excludeValueList.size())) { 168 throw new IndexOutOfBoundsException (); 169 } 170 171 return (com.calipso.reportgenerator.reportdefinitions.ExcludeValue) _excludeValueList.elementAt(index); 172 } 174 177 public com.calipso.reportgenerator.reportdefinitions.ExcludeValue[] getExcludeValue() 178 { 179 int size = _excludeValueList.size(); 180 com.calipso.reportgenerator.reportdefinitions.ExcludeValue[] mArray = new com.calipso.reportgenerator.reportdefinitions.ExcludeValue[size]; 181 for (int index = 0; index < size; index++) { 182 mArray[index] = (com.calipso.reportgenerator.reportdefinitions.ExcludeValue) _excludeValueList.elementAt(index); 183 } 184 return mArray; 185 } 187 190 public int getExcludeValueCount() 191 { 192 return _excludeValueList.size(); 193 } 195 200 public com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType getLocation() 201 { 202 return this._location; 203 } 205 210 public com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType getOrder() 211 { 212 return this._order; 213 } 215 221 public java.lang.String getRankMetricName() 222 { 223 return this._rankMetricName; 224 } 226 231 public int getUbication() 232 { 233 return this._ubication; 234 } 236 241 public int getWidth() 242 { 243 return this._width; 244 } 246 249 public boolean hasUbication() 250 { 251 return this._has_ubication; 252 } 254 257 public boolean hasWidth() 258 { 259 return this._has_width; 260 } 262 265 public boolean isValid() 266 { 267 try { 268 validate(); 269 } 270 catch (org.exolab.castor.xml.ValidationException vex) { 271 return false; 272 } 273 return true; 274 } 276 281 public void marshal(java.io.Writer out) 282 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 283 { 284 285 Marshaller.marshal(this, out); 286 } 288 293 public void marshal(org.xml.sax.ContentHandler handler) 294 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 295 { 296 297 Marshaller.marshal(this, handler); 298 } 300 303 public void removeAllExcludeValue() 304 { 305 _excludeValueList.removeAllElements(); 306 } 308 313 public com.calipso.reportgenerator.reportdefinitions.ExcludeValue removeExcludeValue(int index) 314 { 315 java.lang.Object obj = _excludeValueList.elementAt(index); 316 _excludeValueList.removeElementAt(index); 317 return (com.calipso.reportgenerator.reportdefinitions.ExcludeValue) obj; 318 } 320 326 public void setDimensionName(java.lang.String dimensionName) 327 { 328 this._dimensionName = dimensionName; 329 } 331 337 public void setExcludeValue(int index, com.calipso.reportgenerator.reportdefinitions.ExcludeValue vExcludeValue) 338 throws java.lang.IndexOutOfBoundsException 339 { 340 if ((index < 0) || (index > _excludeValueList.size())) { 342 throw new IndexOutOfBoundsException (); 343 } 344 _excludeValueList.setElementAt(vExcludeValue, index); 345 } 347 352 public void setExcludeValue(com.calipso.reportgenerator.reportdefinitions.ExcludeValue[] excludeValueArray) 353 { 354 _excludeValueList.removeAllElements(); 356 for (int i = 0; i < excludeValueArray.length; i++) { 357 _excludeValueList.addElement(excludeValueArray[i]); 358 } 359 } 361 366 public void setLocation(com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyLocationType location) 367 { 368 this._location = location; 369 } 371 376 public void setOrder(com.calipso.reportgenerator.reportdefinitions.types.DimensionPropertyOrderType order) 377 { 378 this._order = order; 379 } 381 387 public void setRankMetricName(java.lang.String rankMetricName) 388 { 389 this._rankMetricName = rankMetricName; 390 } 392 397 public void setUbication(int ubication) 398 { 399 this._ubication = ubication; 400 this._has_ubication = true; 401 } 403 408 public void setWidth(int width) 409 { 410 this._width = width; 411 this._has_width = true; 412 } 414 419 public static com.calipso.reportgenerator.reportdefinitions.DimensionProperty unmarshal(java.io.Reader reader) 420 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 421 { 422 return (com.calipso.reportgenerator.reportdefinitions.DimensionProperty) Unmarshaller.unmarshal(com.calipso.reportgenerator.reportdefinitions.DimensionProperty.class, reader); 423 } 425 428 public void validate() 429 throws org.exolab.castor.xml.ValidationException 430 { 431 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 432 validator.validate(this); 433 } 435 } 436 | Popular Tags |