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: DataType.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   * a (VOTable-supported) data type
26   *  
27   * 
28   * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:25 $
29   */
30  public class DataType extends org.astrogrid.common.bean.BaseBean 
31  implements java.io.Serializable
32  {
33  
34  
35        //--------------------------/
36       //- Class/Member Variables -/
37      //--------------------------/
38  
39      /***
40       * internal content storage
41       */
42      private java.lang.String _content;
43  
44      /***
45       * the shape of the array that constitutes the value
46       *  
47       */
48      private java.lang.String _arraysize = "1";
49  
50  
51        //----------------/
52       //- Constructors -/
53      //----------------/
54  
55      public DataType() {
56          super();
57          setArraysize("1");
58      } //-- org.astrogrid.registry.beans.v10.resource.dataservice.DataType()
59  
60  
61        //-----------/
62       //- Methods -/
63      //-----------/
64  
65      /***
66       * Note: hashCode() has not been overriden
67       * 
68       * @param obj
69       */
70      public boolean equals(java.lang.Object obj)
71      {
72          if ( this == obj )
73              return true;
74          
75          if (super.equals(obj)==false)
76              return false;
77          
78          if (obj instanceof DataType) {
79          
80              DataType temp = (DataType)obj;
81              if (this._content != null) {
82                  if (temp._content == null) return false;
83                  else if (!(this._content.equals(temp._content))) 
84                      return false;
85              }
86              else if (temp._content != null)
87                  return false;
88              if (this._arraysize != null) {
89                  if (temp._arraysize == null) return false;
90                  else if (!(this._arraysize.equals(temp._arraysize))) 
91                      return false;
92              }
93              else if (temp._arraysize != null)
94                  return false;
95              return true;
96          }
97          return false;
98      } //-- boolean equals(java.lang.Object) 
99  
100     /***
101      * Returns the value of field 'arraysize'. The field
102      * 'arraysize' has the following description: the shape of the
103      * array that constitutes the value
104      *  
105      * 
106      * @return the value of field 'arraysize'.
107      */
108     public java.lang.String getArraysize()
109     {
110         return this._arraysize;
111     } //-- java.lang.String getArraysize() 
112 
113     /***
114      * Returns the value of field 'content'. The field 'content'
115      * has the following description: internal content storage
116      * 
117      * @return the value of field 'content'.
118      */
119     public java.lang.String getContent()
120     {
121         return this._content;
122     } //-- java.lang.String getContent() 
123 
124     /***
125      * Method isValid
126      */
127     public boolean isValid()
128     {
129         try {
130             validate();
131         }
132         catch (org.exolab.castor.xml.ValidationException vex) {
133             return false;
134         }
135         return true;
136     } //-- boolean isValid() 
137 
138     /***
139      * Method marshal
140      * 
141      * @param out
142      */
143     public void marshal(java.io.Writer out)
144         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
145     {
146         
147         Marshaller.marshal(this, out);
148     } //-- void marshal(java.io.Writer) 
149 
150     /***
151      * Method marshal
152      * 
153      * @param handler
154      */
155     public void marshal(org.xml.sax.ContentHandler handler)
156         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
157     {
158         
159         Marshaller.marshal(this, handler);
160     } //-- void marshal(org.xml.sax.ContentHandler) 
161 
162     /***
163      * Sets the value of field 'arraysize'. The field 'arraysize'
164      * has the following description: the shape of the array that
165      * constitutes the value
166      *  
167      * 
168      * @param arraysize the value of field 'arraysize'.
169      */
170     public void setArraysize(java.lang.String arraysize)
171     {
172         this._arraysize = arraysize;
173     } //-- void setArraysize(java.lang.String) 
174 
175     /***
176      * Sets the value of field 'content'. The field 'content' has
177      * the following description: internal content storage
178      * 
179      * @param content the value of field 'content'.
180      */
181     public void setContent(java.lang.String content)
182     {
183         this._content = content;
184     } //-- void setContent(java.lang.String) 
185 
186     /***
187      * Method unmarshalDataType
188      * 
189      * @param reader
190      */
191     public static org.astrogrid.registry.beans.v10.resource.dataservice.DataType unmarshalDataType(java.io.Reader reader)
192         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
193     {
194         return (org.astrogrid.registry.beans.v10.resource.dataservice.DataType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.dataservice.DataType.class, reader);
195     } //-- org.astrogrid.registry.beans.v10.resource.dataservice.DataType unmarshalDataType(java.io.Reader) 
196 
197     /***
198      * Method validate
199      */
200     public void validate()
201         throws org.exolab.castor.xml.ValidationException
202     {
203         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
204         validator.validate(this);
205     } //-- void validate() 
206 
207 }