log validation errors which cause the 'mergeRoots' call to fail.
[vamsas.git] / src / uk / ac / vamsas / objects / core / DataSetAnnotations.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class DataSetAnnotations.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class DataSetAnnotations extends uk.ac.vamsas.objects.core.RangeAnnotation 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * annotation is associated with a
33      *  particular dataset sequence 
34      */
35     private java.lang.Object _seqRef;
36
37     /**
38      * Field _provenance.
39      */
40     private uk.ac.vamsas.objects.core.Provenance _provenance;
41
42
43       //----------------/
44      //- Constructors -/
45     //----------------/
46
47     public DataSetAnnotations() {
48         super();
49     }
50
51
52       //-----------/
53      //- Methods -/
54     //-----------/
55
56     /**
57      * Overrides the java.lang.Object.equals method.
58      * 
59      * @param obj
60      * @return true if the objects are equal.
61      */
62     public boolean equals(
63             final java.lang.Object obj) {
64         if ( this == obj )
65             return true;
66         
67         if (super.equals(obj)==false)
68             return false;
69         
70         if (obj instanceof DataSetAnnotations) {
71         
72             DataSetAnnotations temp = (DataSetAnnotations)obj;
73             if (this._seqRef != null) {
74                 if (temp._seqRef == null) return false;
75                 else if (!(this._seqRef.equals(temp._seqRef))) 
76                     return false;
77             }
78             else if (temp._seqRef != null)
79                 return false;
80             if (this._provenance != null) {
81                 if (temp._provenance == null) return false;
82                 else if (!(this._provenance.equals(temp._provenance))) 
83                     return false;
84             }
85             else if (temp._provenance != null)
86                 return false;
87             return true;
88         }
89         return false;
90     }
91
92     /**
93      * Returns the value of field 'provenance'.
94      * 
95      * @return the value of field 'Provenance'.
96      */
97     public uk.ac.vamsas.objects.core.Provenance getProvenance(
98     ) {
99         return this._provenance;
100     }
101
102     /**
103      * Returns the value of field 'seqRef'. The field 'seqRef' has
104      * the following description: annotation is associated with a
105      *  particular dataset sequence 
106      * 
107      * @return the value of field 'SeqRef'.
108      */
109     public java.lang.Object getSeqRef(
110     ) {
111         return this._seqRef;
112     }
113
114     /**
115      * Overrides the java.lang.Object.hashCode method.
116      * <p>
117      * The following steps came from <b>Effective Java Programming
118      * Language Guide</b> by Joshua Bloch, Chapter 3
119      * 
120      * @return a hash code value for the object.
121      */
122     public int hashCode(
123     ) {
124         int result = super.hashCode();
125         
126         long tmp;
127         if (_seqRef != null) {
128            result = 37 * result + _seqRef.hashCode();
129         }
130         if (_provenance != null) {
131            result = 37 * result + _provenance.hashCode();
132         }
133         
134         return result;
135     }
136
137     /**
138      * Method isValid.
139      * 
140      * @return true if this object is valid according to the schema
141      */
142     public boolean isValid(
143     ) {
144         try {
145             validate();
146         } catch (org.exolab.castor.xml.ValidationException vex) {
147             return false;
148         }
149         return true;
150     }
151
152     /**
153      * 
154      * 
155      * @param out
156      * @throws org.exolab.castor.xml.MarshalException if object is
157      * null or if any SAXException is thrown during marshaling
158      * @throws org.exolab.castor.xml.ValidationException if this
159      * object is an invalid instance according to the schema
160      */
161     public void marshal(
162             final java.io.Writer out)
163     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
164         Marshaller.marshal(this, out);
165     }
166
167     /**
168      * 
169      * 
170      * @param handler
171      * @throws java.io.IOException if an IOException occurs during
172      * marshaling
173      * @throws org.exolab.castor.xml.ValidationException if this
174      * object is an invalid instance according to the schema
175      * @throws org.exolab.castor.xml.MarshalException if object is
176      * null or if any SAXException is thrown during marshaling
177      */
178     public void marshal(
179             final org.xml.sax.ContentHandler handler)
180     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
181         Marshaller.marshal(this, handler);
182     }
183
184     /**
185      * Sets the value of field 'provenance'.
186      * 
187      * @param provenance the value of field 'provenance'.
188      */
189     public void setProvenance(
190             final uk.ac.vamsas.objects.core.Provenance provenance) {
191         this._provenance = provenance;
192     }
193
194     /**
195      * Sets the value of field 'seqRef'. The field 'seqRef' has the
196      * following description: annotation is associated with a
197      *  particular dataset sequence 
198      * 
199      * @param seqRef the value of field 'seqRef'.
200      */
201     public void setSeqRef(
202             final java.lang.Object seqRef) {
203         this._seqRef = seqRef;
204     }
205
206     /**
207      * Method unmarshal.
208      * 
209      * @param reader
210      * @throws org.exolab.castor.xml.MarshalException if object is
211      * null or if any SAXException is thrown during marshaling
212      * @throws org.exolab.castor.xml.ValidationException if this
213      * object is an invalid instance according to the schema
214      * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
215      */
216     public static uk.ac.vamsas.objects.core.RangeType unmarshal(
217             final java.io.Reader reader)
218     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
219         return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader);
220     }
221
222     /**
223      * 
224      * 
225      * @throws org.exolab.castor.xml.ValidationException if this
226      * object is an invalid instance according to the schema
227      */
228     public void validate(
229     )
230     throws org.exolab.castor.xml.ValidationException {
231         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
232         validator.validate(this);
233     }
234
235 }