View Javadoc

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