/* * This class was automatically generated with * Castor 0.9.9M2, using an XML * Schema. * $Id$ */ package uk.ac.vamsas.objects.core; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import java.io.IOException; import java.io.Reader; import java.io.Serializable; import java.io.Writer; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** * Class Attachment. * * @version $Revision$ $Date$ */ public class Attachment extends uk.ac.vamsas.objects.core.AppData implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * true implies data will be decompresses with Zip * before presenting to application */ private boolean _compressed = false; /** * keeps track of state for field: _compressed */ private boolean _has_compressed; /** * Type of arbitrary data - TODO: decide format - use * (extended) MIME types ? */ private java.lang.String _type; /** * Object the arbitrary data is associated with * */ private java.lang.Object _objectref; /** * Primary Key for vamsas object referencing * */ private java.lang.String _id; //----------------/ //- Constructors -/ //----------------/ public Attachment() { super(); } //-- uk.ac.vamsas.objects.core.Attachment() //-----------/ //- Methods -/ //-----------/ /** * Method deleteCompressed * */ public void deleteCompressed() { this._has_compressed= false; } //-- void deleteCompressed() /** * Note: hashCode() has not been overriden * * @param obj * @return boolean */ public boolean equals(java.lang.Object obj) { if ( this == obj ) return true; if (super.equals(obj)==false) return false; if (obj instanceof Attachment) { Attachment temp = (Attachment)obj; if (this._compressed != temp._compressed) return false; if (this._has_compressed != temp._has_compressed) return false; if (this._type != null) { if (temp._type == null) return false; else if (!(this._type.equals(temp._type))) return false; } else if (temp._type != null) return false; if (this._objectref != null) { if (temp._objectref == null) return false; else if (!(this._objectref.equals(temp._objectref))) return false; } else if (temp._objectref != null) return false; if (this._id != null) { if (temp._id == null) return false; else if (!(this._id.equals(temp._id))) return false; } else if (temp._id != null) return false; return true; } return false; } //-- boolean equals(java.lang.Object) /** * Returns the value of field 'compressed'. The field * 'compressed' has the following description: true implies * data will be decompresses with Zip * before presenting to application * * @return boolean * @return the value of field 'compressed'. */ public boolean getCompressed() { return this._compressed; } //-- boolean getCompressed() /** * Returns the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * * * @return String * @return the value of field 'id'. */ public java.lang.String getId() { return this._id; } //-- java.lang.String getId() /** * Returns the value of field 'objectref'. The field * 'objectref' has the following description: Object the * arbitrary data is associated with * * * @return Object * @return the value of field 'objectref'. */ public java.lang.Object getObjectref() { return this._objectref; } //-- java.lang.Object getObjectref() /** * Returns the value of field 'type'. The field 'type' has the * following description: Type of arbitrary data - TODO: decide * format - use * (extended) MIME types ? * * @return String * @return the value of field 'type'. */ public java.lang.String getType() { return this._type; } //-- java.lang.String getType() /** * Method hasCompressed * * * * @return boolean */ public boolean hasCompressed() { return this._has_compressed; } //-- boolean hasCompressed() /** * Method isValid * * * * @return boolean */ public boolean isValid() { try { validate(); } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; } //-- boolean isValid() /** * Method marshal * * * * @param out */ public void marshal(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); } //-- void marshal(java.io.Writer) /** * Method marshal * * * * @param handler */ public void marshal(org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); } //-- void marshal(org.xml.sax.ContentHandler) /** * Sets the value of field 'compressed'. The field 'compressed' * has the following description: true implies data will be * decompresses with Zip * before presenting to application * * @param compressed the value of field 'compressed'. */ public void setCompressed(boolean compressed) { this._compressed = compressed; this._has_compressed = true; } //-- void setCompressed(boolean) /** * Sets the value of field 'id'. The field 'id' has the * following description: Primary Key for vamsas object * referencing * * * @param id the value of field 'id'. */ public void setId(java.lang.String id) { this._id = id; } //-- void setId(java.lang.String) /** * Sets the value of field 'objectref'. The field 'objectref' * has the following description: Object the arbitrary data is * associated with * * * @param objectref the value of field 'objectref'. */ public void setObjectref(java.lang.Object objectref) { this._objectref = objectref; } //-- void setObjectref(java.lang.Object) /** * Sets the value of field 'type'. The field 'type' has the * following description: Type of arbitrary data - TODO: decide * format - use * (extended) MIME types ? * * @param type the value of field 'type'. */ public void setType(java.lang.String type) { this._type = type; } //-- void setType(java.lang.String) /** * Method unmarshal * * * * @param reader * @return AppData */ public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Attachment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Attachment.class, reader); } //-- uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader) /** * Method validate * */ public void validate() throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); } //-- void validate() }