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