1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.dataservice;
9
10
11
12
13
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 /***
25 * Class ParamType.
26 *
27 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:07 $
28 */
29 public class ParamType extends org.astrogrid.common.bean.BaseBean
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * the name of someone or something
40 */
41 private java.lang.String _name;
42
43 /***
44 * An account of the nature of the resource
45 *
46 */
47 private java.lang.String _description;
48
49 /***
50 * a (VOTable-supported) data type
51 *
52 */
53 private org.astrogrid.registry.beans.resource.dataservice.DataType _dataType;
54
55 /***
56 * the measurement unit associated with a measurement.
57 *
58 */
59 private java.lang.String _unit;
60
61 /***
62 * the name of a unified content descriptor. See ....
63 *
64 */
65 private java.lang.String _UCD;
66
67
68
69
70
71
72 public ParamType() {
73 super();
74 }
75
76
77
78
79
80
81 /***
82 * Note: hashCode() has not been overriden
83 *
84 * @param obj
85 */
86 public boolean equals(java.lang.Object obj)
87 {
88 if ( this == obj )
89 return true;
90
91 if (super.equals(obj)==false)
92 return false;
93
94 if (obj instanceof ParamType) {
95
96 ParamType temp = (ParamType)obj;
97 if (this._name != null) {
98 if (temp._name == null) return false;
99 else if (!(this._name.equals(temp._name)))
100 return false;
101 }
102 else if (temp._name != null)
103 return false;
104 if (this._description != null) {
105 if (temp._description == null) return false;
106 else if (!(this._description.equals(temp._description)))
107 return false;
108 }
109 else if (temp._description != null)
110 return false;
111 if (this._dataType != null) {
112 if (temp._dataType == null) return false;
113 else if (!(this._dataType.equals(temp._dataType)))
114 return false;
115 }
116 else if (temp._dataType != null)
117 return false;
118 if (this._unit != null) {
119 if (temp._unit == null) return false;
120 else if (!(this._unit.equals(temp._unit)))
121 return false;
122 }
123 else if (temp._unit != null)
124 return false;
125 if (this._UCD != null) {
126 if (temp._UCD == null) return false;
127 else if (!(this._UCD.equals(temp._UCD)))
128 return false;
129 }
130 else if (temp._UCD != null)
131 return false;
132 return true;
133 }
134 return false;
135 }
136
137 /***
138 * Returns the value of field 'dataType'. The field 'dataType'
139 * has the following description: a (VOTable-supported) data
140 * type
141 *
142 *
143 * @return the value of field 'dataType'.
144 */
145 public org.astrogrid.registry.beans.resource.dataservice.DataType getDataType()
146 {
147 return this._dataType;
148 }
149
150 /***
151 * Returns the value of field 'description'. The field
152 * 'description' has the following description: An account of
153 * the nature of the resource
154 *
155 *
156 * @return the value of field 'description'.
157 */
158 public java.lang.String getDescription()
159 {
160 return this._description;
161 }
162
163 /***
164 * Returns the value of field 'name'. The field 'name' has the
165 * following description: the name of someone or something
166 *
167 * @return the value of field 'name'.
168 */
169 public java.lang.String getName()
170 {
171 return this._name;
172 }
173
174 /***
175 * Returns the value of field 'UCD'. The field 'UCD' has the
176 * following description: the name of a unified content
177 * descriptor. See ....
178 *
179 *
180 * @return the value of field 'UCD'.
181 */
182 public java.lang.String getUCD()
183 {
184 return this._UCD;
185 }
186
187 /***
188 * Returns the value of field 'unit'. The field 'unit' has the
189 * following description: the measurement unit associated with
190 * a measurement.
191 *
192 *
193 * @return the value of field 'unit'.
194 */
195 public java.lang.String getUnit()
196 {
197 return this._unit;
198 }
199
200 /***
201 * Method isValid
202 */
203 public boolean isValid()
204 {
205 try {
206 validate();
207 }
208 catch (org.exolab.castor.xml.ValidationException vex) {
209 return false;
210 }
211 return true;
212 }
213
214 /***
215 * Method marshal
216 *
217 * @param out
218 */
219 public void marshal(java.io.Writer out)
220 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
221 {
222
223 Marshaller.marshal(this, out);
224 }
225
226 /***
227 * Method marshal
228 *
229 * @param handler
230 */
231 public void marshal(org.xml.sax.ContentHandler handler)
232 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
233 {
234
235 Marshaller.marshal(this, handler);
236 }
237
238 /***
239 * Sets the value of field 'dataType'. The field 'dataType' has
240 * the following description: a (VOTable-supported) data type
241 *
242 *
243 * @param dataType the value of field 'dataType'.
244 */
245 public void setDataType(org.astrogrid.registry.beans.resource.dataservice.DataType dataType)
246 {
247 this._dataType = dataType;
248 }
249
250 /***
251 * Sets the value of field 'description'. The field
252 * 'description' has the following description: An account of
253 * the nature of the resource
254 *
255 *
256 * @param description the value of field 'description'.
257 */
258 public void setDescription(java.lang.String description)
259 {
260 this._description = description;
261 }
262
263 /***
264 * Sets the value of field 'name'. The field 'name' has the
265 * following description: the name of someone or something
266 *
267 * @param name the value of field 'name'.
268 */
269 public void setName(java.lang.String name)
270 {
271 this._name = name;
272 }
273
274 /***
275 * Sets the value of field 'UCD'. The field 'UCD' has the
276 * following description: the name of a unified content
277 * descriptor. See ....
278 *
279 *
280 * @param UCD the value of field 'UCD'.
281 */
282 public void setUCD(java.lang.String UCD)
283 {
284 this._UCD = UCD;
285 }
286
287 /***
288 * Sets the value of field 'unit'. The field 'unit' has the
289 * following description: the measurement unit associated with
290 * a measurement.
291 *
292 *
293 * @param unit the value of field 'unit'.
294 */
295 public void setUnit(java.lang.String unit)
296 {
297 this._unit = unit;
298 }
299
300 /***
301 * Method unmarshalParamType
302 *
303 * @param reader
304 */
305 public static org.astrogrid.registry.beans.resource.dataservice.ParamType unmarshalParamType(java.io.Reader reader)
306 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
307 {
308 return (org.astrogrid.registry.beans.resource.dataservice.ParamType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.dataservice.ParamType.class, reader);
309 }
310
311 /***
312 * Method validate
313 */
314 public void validate()
315 throws org.exolab.castor.xml.ValidationException
316 {
317 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
318 validator.validate(this);
319 }
320
321 }