2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package uk.ac.vamsas.objects.core;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
20 * @version $Revision$ $Date$
\r
22 public class AppData extends uk.ac.vamsas.client.Vobject
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * Internal choice value storage
\r
34 private java.lang.Object _choiceValue;
\r
39 private byte[] _data;
\r
42 * Field _dataReference.
\r
44 private java.lang.String _dataReference;
\r
61 * Overrides the java.lang.Object.equals method.
\r
64 * @return true if the objects are equal.
\r
66 public boolean equals(
\r
67 final java.lang.Object obj) {
\r
71 if (super.equals(obj)==false)
\r
74 if (obj instanceof AppData) {
\r
76 AppData temp = (AppData)obj;
\r
77 if (this._choiceValue != null) {
\r
78 if (temp._choiceValue == null) return false;
\r
79 else if (!(this._choiceValue.equals(temp._choiceValue)))
\r
82 else if (temp._choiceValue != null)
\r
84 if (this._data != null) {
\r
85 if (temp._data == null) return false;
\r
86 else if (!(java.util.Arrays.equals(this._data, temp._data)))
\r
89 else if (temp._data != null)
\r
91 if (this._dataReference != null) {
\r
92 if (temp._dataReference == null) return false;
\r
93 else if (!(this._dataReference.equals(temp._dataReference)))
\r
96 else if (temp._dataReference != null)
\r
104 * Returns the value of field 'choiceValue'. The field
\r
105 * 'choiceValue' has the following description: Internal choice
\r
108 * @return the value of field 'ChoiceValue'.
\r
110 public java.lang.Object getChoiceValue(
\r
112 return this._choiceValue;
\r
116 * Returns the value of field 'data'.
\r
118 * @return the value of field 'Data'.
\r
120 public byte[] getData(
\r
126 * Returns the value of field 'dataReference'.
\r
128 * @return the value of field 'DataReference'.
\r
130 public java.lang.String getDataReference(
\r
132 return this._dataReference;
\r
136 * Overrides the java.lang.Object.hashCode method.
\r
138 * The following steps came from <b>Effective Java Programming
\r
139 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
141 * @return a hash code value for the object.
\r
143 public int hashCode(
\r
145 int result = super.hashCode();
\r
148 if (_choiceValue != null) {
\r
149 result = 37 * result + _choiceValue.hashCode();
\r
151 if (_data != null) {
\r
152 result = 37 * result + _data.hashCode();
\r
154 if (_dataReference != null) {
\r
155 result = 37 * result + _dataReference.hashCode();
\r
164 * @return true if this object is valid according to the schema
\r
166 public boolean isValid(
\r
170 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
180 * @throws org.exolab.castor.xml.MarshalException if object is
\r
181 * null or if any SAXException is thrown during marshaling
\r
182 * @throws org.exolab.castor.xml.ValidationException if this
\r
183 * object is an invalid instance according to the schema
\r
185 public void marshal(
\r
186 final java.io.Writer out)
\r
187 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
188 Marshaller.marshal(this, out);
\r
195 * @throws java.io.IOException if an IOException occurs during
\r
197 * @throws org.exolab.castor.xml.ValidationException if this
\r
198 * object is an invalid instance according to the schema
\r
199 * @throws org.exolab.castor.xml.MarshalException if object is
\r
200 * null or if any SAXException is thrown during marshaling
\r
202 public void marshal(
\r
203 final org.xml.sax.ContentHandler handler)
\r
204 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
205 Marshaller.marshal(this, handler);
\r
209 * Sets the value of field 'data'.
\r
211 * @param data the value of field 'data'.
\r
213 public void setData(
\r
214 final byte[] data) {
\r
216 this._choiceValue = data;
\r
220 * Sets the value of field 'dataReference'.
\r
222 * @param dataReference the value of field 'dataReference'.
\r
224 public void setDataReference(
\r
225 final java.lang.String dataReference) {
\r
226 this._dataReference = dataReference;
\r
227 this._choiceValue = dataReference;
\r
231 * Method unmarshal.
\r
234 * @throws org.exolab.castor.xml.MarshalException if object is
\r
235 * null or if any SAXException is thrown during marshaling
\r
236 * @throws org.exolab.castor.xml.ValidationException if this
\r
237 * object is an invalid instance according to the schema
\r
238 * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
\r
240 public static uk.ac.vamsas.objects.core.AppData unmarshal(
\r
241 final java.io.Reader reader)
\r
242 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
243 return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AppData.class, reader);
\r
249 * @throws org.exolab.castor.xml.ValidationException if this
\r
250 * object is an invalid instance according to the schema
\r
252 public void validate(
\r
254 throws org.exolab.castor.xml.ValidationException {
\r
255 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
256 validator.validate(this);
\r