2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
\r
8 package org.vamsas.objects.core;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\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
27 * @version $Revision$ $Date$
\r
29 public class Attachment extends org.vamsas.objects.core.AppData
\r
30 implements java.io.Serializable
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
39 * true implies data will be decompresses
\r
40 * with Zip before presenting to
\r
44 private boolean _compressed = false;
\r
47 * keeps track of state for field: _compressed
\r
49 private boolean _has_compressed;
\r
52 * Type of arbitrary data - TODO: decide
\r
53 * format - use (extended) MIME types ?
\r
56 private java.lang.String _type;
\r
59 * Object the arbitrary data is associated
\r
63 private java.lang.Object _objectref;
\r
66 * Primary Key for vamsas object
\r
70 private java.lang.String _id;
\r
77 public Attachment()
\r
80 } //-- org.vamsas.objects.core.Attachment()
\r
88 * Method deleteCompressed
\r
91 public void deleteCompressed()
\r
93 this._has_compressed= false;
\r
94 } //-- void deleteCompressed()
\r
97 * Note: hashCode() has not been overriden
\r
102 public boolean equals(java.lang.Object obj)
\r
107 if (super.equals(obj)==false)
\r
110 if (obj instanceof Attachment) {
\r
112 Attachment temp = (Attachment)obj;
\r
113 if (this._compressed != temp._compressed)
\r
115 if (this._has_compressed != temp._has_compressed)
\r
117 if (this._type != null) {
\r
118 if (temp._type == null) return false;
\r
119 else if (!(this._type.equals(temp._type)))
\r
122 else if (temp._type != null)
\r
124 if (this._objectref != null) {
\r
125 if (temp._objectref == null) return false;
\r
126 else if (!(this._objectref.equals(temp._objectref)))
\r
129 else if (temp._objectref != null)
\r
131 if (this._id != null) {
\r
132 if (temp._id == null) return false;
\r
133 else if (!(this._id.equals(temp._id)))
\r
136 else if (temp._id != null)
\r
141 } //-- boolean equals(java.lang.Object)
\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
152 * @return the value of field 'compressed'.
\r
154 public boolean getCompressed()
\r
156 return this._compressed;
\r
157 } //-- boolean getCompressed()
\r
160 * Returns the value of field 'id'. The field 'id' has the
\r
161 * following description: Primary Key for vamsas object
\r
166 * @return the value of field 'id'.
\r
168 public java.lang.String getId()
\r
171 } //-- java.lang.String getId()
\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
181 * @return the value of field 'objectref'.
\r
183 public java.lang.Object getObjectref()
\r
185 return this._objectref;
\r
186 } //-- java.lang.Object getObjectref()
\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
195 * @return the value of field 'type'.
\r
197 public java.lang.String getType()
\r
200 } //-- java.lang.String getType()
\r
203 * Method hasCompressed
\r
209 public boolean hasCompressed()
\r
211 return this._has_compressed;
\r
212 } //-- boolean hasCompressed()
\r
221 public boolean isValid()
\r
226 catch (org.exolab.castor.xml.ValidationException vex) {
\r
230 } //-- boolean isValid()
\r
239 public void marshal(java.io.Writer out)
\r
240 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
243 Marshaller.marshal(this, out);
\r
244 } //-- void marshal(java.io.Writer)
\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
257 Marshaller.marshal(this, handler);
\r
258 } //-- void marshal(org.xml.sax.ContentHandler)
\r
261 * Sets the value of field 'compressed'. The field 'compressed'
\r
262 * has the following description: true implies data will be
\r
264 * with Zip before presenting to
\r
268 * @param compressed the value of field 'compressed'.
\r
270 public void setCompressed(boolean compressed)
\r
272 this._compressed = compressed;
\r
273 this._has_compressed = true;
\r
274 } //-- void setCompressed(boolean)
\r
277 * Sets the value of field 'id'. The field 'id' has the
\r
278 * following description: Primary Key for vamsas object
\r
282 * @param id the value of field 'id'.
\r
284 public void setId(java.lang.String id)
\r
287 } //-- void setId(java.lang.String)
\r
290 * Sets the value of field 'objectref'. The field 'objectref'
\r
291 * has the following description: Object the arbitrary data is
\r
296 * @param objectref the value of field 'objectref'.
\r
298 public void setObjectref(java.lang.Object objectref)
\r
300 this._objectref = objectref;
\r
301 } //-- void setObjectref(java.lang.Object)
\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
309 * @param type the value of field 'type'.
\r
311 public void setType(java.lang.String type)
\r
314 } //-- void setType(java.lang.String)
\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
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
334 public void validate()
\r
335 throws org.exolab.castor.xml.ValidationException
\r
337 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
338 validator.validate(this);
\r
339 } //-- void validate()
\r