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