2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package uk.ac.vamsas.objects.core;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
20 * @version $Revision$ $Date$
\r
22 public class Mapping extends uk.ac.vamsas.objects.core.MapList
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * object to which the mapping is being mapped
\r
35 private java.lang.Object _onto;
\r
52 * Overrides the java.lang.Object.equals method.
\r
55 * @return true if the objects are equal.
\r
57 public boolean equals(
\r
58 final java.lang.Object obj) {
\r
62 if (super.equals(obj)==false)
\r
65 if (obj instanceof Mapping) {
\r
67 Mapping temp = (Mapping)obj;
\r
68 if (this._onto != null) {
\r
69 if (temp._onto == null) return false;
\r
70 else if (!(this._onto.equals(temp._onto)))
\r
73 else if (temp._onto != null)
\r
81 * Returns the value of field 'onto'. The field 'onto' has the
\r
82 * following description: object to which the mapping is being
\r
86 * @return the value of field 'Onto'.
\r
88 public java.lang.Object getOnto(
\r
94 * Overrides the java.lang.Object.hashCode method.
\r
96 * The following steps came from <b>Effective Java Programming
\r
97 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
99 * @return a hash code value for the object.
\r
101 public int hashCode(
\r
103 int result = super.hashCode();
\r
106 if (_onto != null) {
\r
107 result = 37 * result + _onto.hashCode();
\r
116 * @return true if this object is valid according to the schema
\r
118 public boolean isValid(
\r
122 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
132 * @throws org.exolab.castor.xml.MarshalException if object is
\r
133 * null or if any SAXException is thrown during marshaling
\r
134 * @throws org.exolab.castor.xml.ValidationException if this
\r
135 * object is an invalid instance according to the schema
\r
137 public void marshal(
\r
138 final java.io.Writer out)
\r
139 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
140 Marshaller.marshal(this, out);
\r
147 * @throws java.io.IOException if an IOException occurs during
\r
149 * @throws org.exolab.castor.xml.ValidationException if this
\r
150 * object is an invalid instance according to the schema
\r
151 * @throws org.exolab.castor.xml.MarshalException if object is
\r
152 * null or if any SAXException is thrown during marshaling
\r
154 public void marshal(
\r
155 final org.xml.sax.ContentHandler handler)
\r
156 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
157 Marshaller.marshal(this, handler);
\r
161 * Sets the value of field 'onto'. The field 'onto' has the
\r
162 * following description: object to which the mapping is being
\r
166 * @param onto the value of field 'onto'.
\r
168 public void setOnto(
\r
169 final java.lang.Object onto) {
\r
174 * Method unmarshal.
\r
177 * @throws org.exolab.castor.xml.MarshalException if object is
\r
178 * null or if any SAXException is thrown during marshaling
\r
179 * @throws org.exolab.castor.xml.ValidationException if this
\r
180 * object is an invalid instance according to the schema
\r
181 * @return the unmarshaled uk.ac.vamsas.objects.core.MapList
\r
183 public static uk.ac.vamsas.objects.core.MapList unmarshal(
\r
184 final java.io.Reader reader)
\r
185 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
186 return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapping.class, reader);
\r
192 * @throws org.exolab.castor.xml.ValidationException if this
\r
193 * object is an invalid instance according to the schema
\r
195 public void validate(
\r
197 throws org.exolab.castor.xml.ValidationException {
\r
198 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
199 validator.validate(this);
\r