Java binding for new document schema (from 1st hinxton vamsas Meeting)
[vamsas.git] / src / org / vamsas / objects / core / Attachment.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 org.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 Attachment.\r
26  * \r
27  * @version $Revision$ $Date$\r
28  */\r
29 public class Attachment extends org.vamsas.objects.core.AppData \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      * true implies data will be decompresses\r
40      *  with Zip before presenting to\r
41      *  application\r
42      *  \r
43      */\r
44     private boolean _compressed = false;\r
45 \r
46     /**\r
47      * keeps track of state for field: _compressed\r
48      */\r
49     private boolean _has_compressed;\r
50 \r
51     /**\r
52      * Type of arbitrary data - TODO: decide\r
53      *  format - use (extended) MIME types ?\r
54      *  \r
55      */\r
56     private java.lang.String _type;\r
57 \r
58     /**\r
59      * Object the arbitrary data is associated\r
60      *  with\r
61      *  \r
62      */\r
63     private java.lang.Object _objectref;\r
64 \r
65     /**\r
66      * Primary Key for vamsas object\r
67      *  referencing\r
68      *  \r
69      */\r
70     private java.lang.String _id;\r
71 \r
72 \r
73       //----------------/\r
74      //- Constructors -/\r
75     //----------------/\r
76 \r
77     public Attachment() \r
78      {\r
79         super();\r
80     } //-- org.vamsas.objects.core.Attachment()\r
81 \r
82 \r
83       //-----------/\r
84      //- Methods -/\r
85     //-----------/\r
86 \r
87     /**\r
88      * Method deleteCompressed\r
89      * \r
90      */\r
91     public void deleteCompressed()\r
92     {\r
93         this._has_compressed= false;\r
94     } //-- void deleteCompressed() \r
95 \r
96     /**\r
97      * Note: hashCode() has not been overriden\r
98      * \r
99      * @param obj\r
100      * @return boolean\r
101      */\r
102     public boolean equals(java.lang.Object obj)\r
103     {\r
104         if ( this == obj )\r
105             return true;\r
106         \r
107         if (super.equals(obj)==false)\r
108             return false;\r
109         \r
110         if (obj instanceof Attachment) {\r
111         \r
112             Attachment temp = (Attachment)obj;\r
113             if (this._compressed != temp._compressed)\r
114                 return false;\r
115             if (this._has_compressed != temp._has_compressed)\r
116                 return false;\r
117             if (this._type != null) {\r
118                 if (temp._type == null) return false;\r
119                 else if (!(this._type.equals(temp._type))) \r
120                     return false;\r
121             }\r
122             else if (temp._type != null)\r
123                 return false;\r
124             if (this._objectref != null) {\r
125                 if (temp._objectref == null) return false;\r
126                 else if (!(this._objectref.equals(temp._objectref))) \r
127                     return false;\r
128             }\r
129             else if (temp._objectref != null)\r
130                 return false;\r
131             if (this._id != null) {\r
132                 if (temp._id == null) return false;\r
133                 else if (!(this._id.equals(temp._id))) \r
134                     return false;\r
135             }\r
136             else if (temp._id != null)\r
137                 return false;\r
138             return true;\r
139         }\r
140         return false;\r
141     } //-- boolean equals(java.lang.Object) \r
142 \r
143     /**\r
144      * Returns the value of field 'compressed'. The field\r
145      * 'compressed' has the following description: true implies\r
146      * data will be decompresses\r
147      *  with Zip before presenting to\r
148      *  application\r
149      *  \r
150      * \r
151      * @return boolean\r
152      * @return the value of field 'compressed'.\r
153      */\r
154     public boolean getCompressed()\r
155     {\r
156         return this._compressed;\r
157     } //-- boolean getCompressed() \r
158 \r
159     /**\r
160      * Returns the value of field 'id'. The field 'id' has the\r
161      * following description: Primary Key for vamsas object\r
162      *  referencing\r
163      *  \r
164      * \r
165      * @return String\r
166      * @return the value of field 'id'.\r
167      */\r
168     public java.lang.String getId()\r
169     {\r
170         return this._id;\r
171     } //-- java.lang.String getId() \r
172 \r
173     /**\r
174      * Returns the value of field 'objectref'. The field\r
175      * 'objectref' has the following description: Object the\r
176      * arbitrary data is associated\r
177      *  with\r
178      *  \r
179      * \r
180      * @return Object\r
181      * @return the value of field 'objectref'.\r
182      */\r
183     public java.lang.Object getObjectref()\r
184     {\r
185         return this._objectref;\r
186     } //-- java.lang.Object getObjectref() \r
187 \r
188     /**\r
189      * Returns the value of field 'type'. The field 'type' has the\r
190      * following description: Type of arbitrary data - TODO: decide\r
191      *  format - use (extended) MIME types ?\r
192      *  \r
193      * \r
194      * @return String\r
195      * @return the value of field 'type'.\r
196      */\r
197     public java.lang.String getType()\r
198     {\r
199         return this._type;\r
200     } //-- java.lang.String getType() \r
201 \r
202     /**\r
203      * Method hasCompressed\r
204      * \r
205      * \r
206      * \r
207      * @return boolean\r
208      */\r
209     public boolean hasCompressed()\r
210     {\r
211         return this._has_compressed;\r
212     } //-- boolean hasCompressed() \r
213 \r
214     /**\r
215      * Method isValid\r
216      * \r
217      * \r
218      * \r
219      * @return boolean\r
220      */\r
221     public boolean isValid()\r
222     {\r
223         try {\r
224             validate();\r
225         }\r
226         catch (org.exolab.castor.xml.ValidationException vex) {\r
227             return false;\r
228         }\r
229         return true;\r
230     } //-- boolean isValid() \r
231 \r
232     /**\r
233      * Method marshal\r
234      * \r
235      * \r
236      * \r
237      * @param out\r
238      */\r
239     public void marshal(java.io.Writer out)\r
240         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
241     {\r
242         \r
243         Marshaller.marshal(this, out);\r
244     } //-- void marshal(java.io.Writer) \r
245 \r
246     /**\r
247      * Method marshal\r
248      * \r
249      * \r
250      * \r
251      * @param handler\r
252      */\r
253     public void marshal(org.xml.sax.ContentHandler handler)\r
254         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
255     {\r
256         \r
257         Marshaller.marshal(this, handler);\r
258     } //-- void marshal(org.xml.sax.ContentHandler) \r
259 \r
260     /**\r
261      * Sets the value of field 'compressed'. The field 'compressed'\r
262      * has the following description: true implies data will be\r
263      * decompresses\r
264      *  with Zip before presenting to\r
265      *  application\r
266      *  \r
267      * \r
268      * @param compressed the value of field 'compressed'.\r
269      */\r
270     public void setCompressed(boolean compressed)\r
271     {\r
272         this._compressed = compressed;\r
273         this._has_compressed = true;\r
274     } //-- void setCompressed(boolean) \r
275 \r
276     /**\r
277      * Sets the value of field 'id'. The field 'id' has the\r
278      * following description: Primary Key for vamsas object\r
279      *  referencing\r
280      *  \r
281      * \r
282      * @param id the value of field 'id'.\r
283      */\r
284     public void setId(java.lang.String id)\r
285     {\r
286         this._id = id;\r
287     } //-- void setId(java.lang.String) \r
288 \r
289     /**\r
290      * Sets the value of field 'objectref'. The field 'objectref'\r
291      * has the following description: Object the arbitrary data is\r
292      * associated\r
293      *  with\r
294      *  \r
295      * \r
296      * @param objectref the value of field 'objectref'.\r
297      */\r
298     public void setObjectref(java.lang.Object objectref)\r
299     {\r
300         this._objectref = objectref;\r
301     } //-- void setObjectref(java.lang.Object) \r
302 \r
303     /**\r
304      * Sets the value of field 'type'. The field 'type' has the\r
305      * following description: Type of arbitrary data - TODO: decide\r
306      *  format - use (extended) MIME types ?\r
307      *  \r
308      * \r
309      * @param type the value of field 'type'.\r
310      */\r
311     public void setType(java.lang.String type)\r
312     {\r
313         this._type = type;\r
314     } //-- void setType(java.lang.String) \r
315 \r
316     /**\r
317      * Method unmarshal\r
318      * \r
319      * \r
320      * \r
321      * @param reader\r
322      * @return AppData\r
323      */\r
324     public static org.vamsas.objects.core.AppData unmarshal(java.io.Reader reader)\r
325         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
326     {\r
327         return (org.vamsas.objects.core.Attachment) Unmarshaller.unmarshal(org.vamsas.objects.core.Attachment.class, reader);\r
328     } //-- org.vamsas.objects.core.AppData unmarshal(java.io.Reader) \r
329 \r
330     /**\r
331      * Method validate\r
332      * \r
333      */\r
334     public void validate()\r
335         throws org.exolab.castor.xml.ValidationException\r
336     {\r
337         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
338         validator.validate(this);\r
339     } //-- void validate() \r
340 \r
341 }\r