refactored org to uk
[vamsas.git] / src / uk / ac / vamsas / objects / core / AppData.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package uk.ac.vamsas.objects.core;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import org.exolab.castor.xml.MarshalException;\r
19 import org.exolab.castor.xml.Marshaller;\r
20 import org.exolab.castor.xml.Unmarshaller;\r
21 import org.exolab.castor.xml.ValidationException;\r
22 import org.xml.sax.ContentHandler;\r
23 \r
24 /**\r
25  * Class AppData.\r
26  * \r
27  * @version $Revision$ $Date$\r
28  */\r
29 public class AppData extends uk.ac.vamsas.client.Vobject \r
30 implements java.io.Serializable\r
31 {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * Internal choice value storage\r
40      */\r
41     private java.lang.Object _choiceValue;\r
42 \r
43     /**\r
44      * Field _data\r
45      */\r
46     private byte[] _data;\r
47 \r
48     /**\r
49      * Field _dataReference\r
50      */\r
51     private java.lang.String _dataReference;\r
52 \r
53 \r
54       //----------------/\r
55      //- Constructors -/\r
56     //----------------/\r
57 \r
58     public AppData() \r
59      {\r
60         super();\r
61     } //-- uk.ac.vamsas.objects.core.AppData()\r
62 \r
63 \r
64       //-----------/\r
65      //- Methods -/\r
66     //-----------/\r
67 \r
68     /**\r
69      * Note: hashCode() has not been overriden\r
70      * \r
71      * @param obj\r
72      * @return boolean\r
73      */\r
74     public boolean equals(java.lang.Object obj)\r
75     {\r
76         if ( this == obj )\r
77             return true;\r
78         \r
79         if (super.equals(obj)==false)\r
80             return false;\r
81         \r
82         if (obj instanceof AppData) {\r
83         \r
84             AppData temp = (AppData)obj;\r
85             if (this._choiceValue != null) {\r
86                 if (temp._choiceValue == null) return false;\r
87                 else if (!(this._choiceValue.equals(temp._choiceValue))) \r
88                     return false;\r
89             }\r
90             else if (temp._choiceValue != null)\r
91                 return false;\r
92             if (this._data != null) {\r
93                 if (temp._data == null) return false;\r
94                 else if (!(this._data.equals(temp._data))) \r
95                     return false;\r
96             }\r
97             else if (temp._data != null)\r
98                 return false;\r
99             if (this._dataReference != null) {\r
100                 if (temp._dataReference == null) return false;\r
101                 else if (!(this._dataReference.equals(temp._dataReference))) \r
102                     return false;\r
103             }\r
104             else if (temp._dataReference != null)\r
105                 return false;\r
106             return true;\r
107         }\r
108         return false;\r
109     } //-- boolean equals(java.lang.Object) \r
110 \r
111     /**\r
112      * Returns the value of field 'choiceValue'. The field\r
113      * 'choiceValue' has the following description: Internal choice\r
114      * value storage\r
115      * \r
116      * @return Object\r
117      * @return the value of field 'choiceValue'.\r
118      */\r
119     public java.lang.Object getChoiceValue()\r
120     {\r
121         return this._choiceValue;\r
122     } //-- java.lang.Object getChoiceValue() \r
123 \r
124     /**\r
125      * Returns the value of field 'data'.\r
126      * \r
127      * @return byte\r
128      * @return the value of field 'data'.\r
129      */\r
130     public byte[] getData()\r
131     {\r
132         return this._data;\r
133     } //-- byte[] getData() \r
134 \r
135     /**\r
136      * Returns the value of field 'dataReference'.\r
137      * \r
138      * @return String\r
139      * @return the value of field 'dataReference'.\r
140      */\r
141     public java.lang.String getDataReference()\r
142     {\r
143         return this._dataReference;\r
144     } //-- java.lang.String getDataReference() \r
145 \r
146     /**\r
147      * Method isValid\r
148      * \r
149      * \r
150      * \r
151      * @return boolean\r
152      */\r
153     public boolean isValid()\r
154     {\r
155         try {\r
156             validate();\r
157         }\r
158         catch (org.exolab.castor.xml.ValidationException vex) {\r
159             return false;\r
160         }\r
161         return true;\r
162     } //-- boolean isValid() \r
163 \r
164     /**\r
165      * Method marshal\r
166      * \r
167      * \r
168      * \r
169      * @param out\r
170      */\r
171     public void marshal(java.io.Writer out)\r
172         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
173     {\r
174         \r
175         Marshaller.marshal(this, out);\r
176     } //-- void marshal(java.io.Writer) \r
177 \r
178     /**\r
179      * Method marshal\r
180      * \r
181      * \r
182      * \r
183      * @param handler\r
184      */\r
185     public void marshal(org.xml.sax.ContentHandler handler)\r
186         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
187     {\r
188         \r
189         Marshaller.marshal(this, handler);\r
190     } //-- void marshal(org.xml.sax.ContentHandler) \r
191 \r
192     /**\r
193      * Sets the value of field 'data'.\r
194      * \r
195      * @param data the value of field 'data'.\r
196      */\r
197     public void setData(byte[] data)\r
198     {\r
199         this._data = data;\r
200         this._choiceValue = data;\r
201     } //-- void setData(byte) \r
202 \r
203     /**\r
204      * Sets the value of field 'dataReference'.\r
205      * \r
206      * @param dataReference the value of field 'dataReference'.\r
207      */\r
208     public void setDataReference(java.lang.String dataReference)\r
209     {\r
210         this._dataReference = dataReference;\r
211         this._choiceValue = dataReference;\r
212     } //-- void setDataReference(java.lang.String) \r
213 \r
214     /**\r
215      * Method unmarshal\r
216      * \r
217      * \r
218      * \r
219      * @param reader\r
220      * @return AppData\r
221      */\r
222     public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader)\r
223         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
224     {\r
225         return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AppData.class, reader);\r
226     } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) \r
227 \r
228     /**\r
229      * Method validate\r
230      * \r
231      */\r
232     public void validate()\r
233         throws org.exolab.castor.xml.ValidationException\r
234     {\r
235         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
236         validator.validate(this);\r
237     } //-- void validate() \r
238 \r
239 }\r