1 7 8 package com.calipso.reportgenerator.reportdefinitions; 9 10 14 import com.calipso.reportgenerator.reportdefinitions.types.DrillDownDefinitionTypeType; 15 import java.io.IOException ; 16 import java.io.Reader ; 17 import java.io.Serializable ; 18 import java.io.Writer ; 19 import java.util.Enumeration ; 20 import java.util.Vector ; 21 import org.exolab.castor.xml.MarshalException; 22 import org.exolab.castor.xml.Marshaller; 23 import org.exolab.castor.xml.Unmarshaller; 24 import org.exolab.castor.xml.ValidationException; 25 import org.xml.sax.ContentHandler ; 26 27 32 public class DrillDownDefinition implements java.io.Serializable { 33 34 35 39 42 private java.lang.String _name; 43 44 47 private java.lang.String _description; 48 49 52 private java.lang.String _targetReportDefinitionID; 53 54 57 private com.calipso.reportgenerator.reportdefinitions.types.DrillDownDefinitionTypeType _type = com.calipso.reportgenerator.reportdefinitions.types.DrillDownDefinitionTypeType.valueOf("CUBE"); 58 59 62 private java.util.Vector _parameterBindList; 63 64 67 private java.util.Vector _dimensionBindList; 68 69 70 74 public DrillDownDefinition() { 75 super(); 76 setType(com.calipso.reportgenerator.reportdefinitions.types.DrillDownDefinitionTypeType.valueOf("CUBE")); 77 _parameterBindList = new Vector (); 78 _dimensionBindList = new Vector (); 79 } 81 82 86 91 public void addDimensionBind(com.calipso.reportgenerator.reportdefinitions.DimensionBind vDimensionBind) 92 throws java.lang.IndexOutOfBoundsException 93 { 94 _dimensionBindList.addElement(vDimensionBind); 95 } 97 103 public void addDimensionBind(int index, com.calipso.reportgenerator.reportdefinitions.DimensionBind vDimensionBind) 104 throws java.lang.IndexOutOfBoundsException 105 { 106 _dimensionBindList.insertElementAt(vDimensionBind, index); 107 } 109 114 public void addParameterBind(com.calipso.reportgenerator.reportdefinitions.ParameterBind vParameterBind) 115 throws java.lang.IndexOutOfBoundsException 116 { 117 _parameterBindList.addElement(vParameterBind); 118 } 120 126 public void addParameterBind(int index, com.calipso.reportgenerator.reportdefinitions.ParameterBind vParameterBind) 127 throws java.lang.IndexOutOfBoundsException 128 { 129 _parameterBindList.insertElementAt(vParameterBind, index); 130 } 132 135 public java.util.Enumeration enumerateDimensionBind() 136 { 137 return _dimensionBindList.elements(); 138 } 140 143 public java.util.Enumeration enumerateParameterBind() 144 { 145 return _parameterBindList.elements(); 146 } 148 154 public java.lang.String getDescription() 155 { 156 return this._description; 157 } 159 164 public com.calipso.reportgenerator.reportdefinitions.DimensionBind getDimensionBind(int index) 165 throws java.lang.IndexOutOfBoundsException 166 { 167 if ((index < 0) || (index > _dimensionBindList.size())) { 169 throw new IndexOutOfBoundsException (); 170 } 171 172 return (com.calipso.reportgenerator.reportdefinitions.DimensionBind) _dimensionBindList.elementAt(index); 173 } 175 178 public com.calipso.reportgenerator.reportdefinitions.DimensionBind[] getDimensionBind() 179 { 180 int size = _dimensionBindList.size(); 181 com.calipso.reportgenerator.reportdefinitions.DimensionBind[] mArray = new com.calipso.reportgenerator.reportdefinitions.DimensionBind[size]; 182 for (int index = 0; index < size; index++) { 183 mArray[index] = (com.calipso.reportgenerator.reportdefinitions.DimensionBind) _dimensionBindList.elementAt(index); 184 } 185 return mArray; 186 } 188 191 public int getDimensionBindCount() 192 { 193 return _dimensionBindList.size(); 194 } 196 201 public java.lang.String getName() 202 { 203 return this._name; 204 } 206 211 public com.calipso.reportgenerator.reportdefinitions.ParameterBind getParameterBind(int index) 212 throws java.lang.IndexOutOfBoundsException 213 { 214 if ((index < 0) || (index > _parameterBindList.size())) { 216 throw new IndexOutOfBoundsException (); 217 } 218 219 return (com.calipso.reportgenerator.reportdefinitions.ParameterBind) _parameterBindList.elementAt(index); 220 } 222 225 public com.calipso.reportgenerator.reportdefinitions.ParameterBind[] getParameterBind() 226 { 227 int size = _parameterBindList.size(); 228 com.calipso.reportgenerator.reportdefinitions.ParameterBind[] mArray = new com.calipso.reportgenerator.reportdefinitions.ParameterBind[size]; 229 for (int index = 0; index < size; index++) { 230 mArray[index] = (com.calipso.reportgenerator.reportdefinitions.ParameterBind) _parameterBindList.elementAt(index); 231 } 232 return mArray; 233 } 235 238 public int getParameterBindCount() 239 { 240 return _parameterBindList.size(); 241 } 243 249 public java.lang.String getTargetReportDefinitionID() 250 { 251 return this._targetReportDefinitionID; 252 } 254 259 public com.calipso.reportgenerator.reportdefinitions.types.DrillDownDefinitionTypeType getType() 260 { 261 return this._type; 262 } 264 267 public boolean isValid() 268 { 269 try { 270 validate(); 271 } 272 catch (org.exolab.castor.xml.ValidationException vex) { 273 return false; 274 } 275 return true; 276 } 278 283 public void marshal(java.io.Writer out) 284 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 285 { 286 287 Marshaller.marshal(this, out); 288 } 290 295 public void marshal(org.xml.sax.ContentHandler handler) 296 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 297 { 298 299 Marshaller.marshal(this, handler); 300 } 302 305 public void removeAllDimensionBind() 306 { 307 _dimensionBindList.removeAllElements(); 308 } 310 313 public void removeAllParameterBind() 314 { 315 _parameterBindList.removeAllElements(); 316 } 318 323 public com.calipso.reportgenerator.reportdefinitions.DimensionBind removeDimensionBind(int index) 324 { 325 java.lang.Object obj = _dimensionBindList.elementAt(index); 326 _dimensionBindList.removeElementAt(index); 327 return (com.calipso.reportgenerator.reportdefinitions.DimensionBind) obj; 328 } 330 335 public com.calipso.reportgenerator.reportdefinitions.ParameterBind removeParameterBind(int index) 336 { 337 java.lang.Object obj = _parameterBindList.elementAt(index); 338 _parameterBindList.removeElementAt(index); 339 return (com.calipso.reportgenerator.reportdefinitions.ParameterBind) obj; 340 } 342 347 public void setDescription(java.lang.String description) 348 { 349 this._description = description; 350 } 352 358 public void setDimensionBind(int index, com.calipso.reportgenerator.reportdefinitions.DimensionBind vDimensionBind) 359 throws java.lang.IndexOutOfBoundsException 360 { 361 if ((index < 0) || (index > _dimensionBindList.size())) { 363 throw new IndexOutOfBoundsException (); 364 } 365 _dimensionBindList.setElementAt(vDimensionBind, index); 366 } 368 373 public void setDimensionBind(com.calipso.reportgenerator.reportdefinitions.DimensionBind[] dimensionBindArray) 374 { 375 _dimensionBindList.removeAllElements(); 377 for (int i = 0; i < dimensionBindArray.length; i++) { 378 _dimensionBindList.addElement(dimensionBindArray[i]); 379 } 380 } 382 387 public void setName(java.lang.String name) 388 { 389 this._name = name; 390 } 392 398 public void setParameterBind(int index, com.calipso.reportgenerator.reportdefinitions.ParameterBind vParameterBind) 399 throws java.lang.IndexOutOfBoundsException 400 { 401 if ((index < 0) || (index > _parameterBindList.size())) { 403 throw new IndexOutOfBoundsException (); 404 } 405 _parameterBindList.setElementAt(vParameterBind, index); 406 } 408 413 public void setParameterBind(com.calipso.reportgenerator.reportdefinitions.ParameterBind[] parameterBindArray) 414 { 415 _parameterBindList.removeAllElements(); 417 for (int i = 0; i < parameterBindArray.length; i++) { 418 _parameterBindList.addElement(parameterBindArray[i]); 419 } 420 } 422 429 public void setTargetReportDefinitionID(java.lang.String targetReportDefinitionID) 430 { 431 this._targetReportDefinitionID = targetReportDefinitionID; 432 } 434 439 public void setType(com.calipso.reportgenerator.reportdefinitions.types.DrillDownDefinitionTypeType type) 440 { 441 this._type = type; 442 } 444 449 public static com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition unmarshal(java.io.Reader reader) 450 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 451 { 452 return (com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition) Unmarshaller.unmarshal(com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition.class, reader); 453 } 455 458 public void validate() 459 throws org.exolab.castor.xml.ValidationException 460 { 461 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 462 validator.validate(this); 463 } 465 } 466 | Popular Tags |