1 7 8 package com.calipso.reportgenerator.reportdefinitions; 9 10 14 import java.io.IOException ; 15 import java.io.Reader ; 16 import java.io.Serializable ; 17 import java.io.Writer ; 18 import org.exolab.castor.xml.MarshalException; 19 import org.exolab.castor.xml.Marshaller; 20 import org.exolab.castor.xml.Unmarshaller; 21 import org.exolab.castor.xml.ValidationException; 22 import org.xml.sax.ContentHandler ; 23 24 29 public class MetricProperty implements java.io.Serializable { 30 31 32 36 39 private java.lang.String _metricName; 40 41 44 private boolean _visible = true; 45 46 49 private boolean _has_visible; 50 51 52 56 public MetricProperty() { 57 super(); 58 } 60 61 65 68 public void deleteVisible() 69 { 70 this._has_visible= false; 71 } 73 78 public java.lang.String getMetricName() 79 { 80 return this._metricName; 81 } 83 88 public boolean getVisible() 89 { 90 return this._visible; 91 } 93 96 public boolean hasVisible() 97 { 98 return this._has_visible; 99 } 101 104 public boolean isValid() 105 { 106 try { 107 validate(); 108 } 109 catch (org.exolab.castor.xml.ValidationException vex) { 110 return false; 111 } 112 return true; 113 } 115 120 public void marshal(java.io.Writer out) 121 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 122 { 123 124 Marshaller.marshal(this, out); 125 } 127 132 public void marshal(org.xml.sax.ContentHandler handler) 133 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 134 { 135 136 Marshaller.marshal(this, handler); 137 } 139 144 public void setMetricName(java.lang.String metricName) 145 { 146 this._metricName = metricName; 147 } 149 154 public void setVisible(boolean visible) 155 { 156 this._visible = visible; 157 this._has_visible = true; 158 } 160 165 public static com.calipso.reportgenerator.reportdefinitions.MetricProperty unmarshal(java.io.Reader reader) 166 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 167 { 168 return (com.calipso.reportgenerator.reportdefinitions.MetricProperty) Unmarshaller.unmarshal(com.calipso.reportgenerator.reportdefinitions.MetricProperty.class, reader); 169 } 171 174 public void validate() 175 throws org.exolab.castor.xml.ValidationException 176 { 177 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 178 validator.validate(this); 179 } 181 } 182 | Popular Tags |