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 Instance extends uk.ac.vamsas.objects.core.AppData
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
34 private java.lang.String _urn;
\r
51 * Overrides the java.lang.Object.equals method.
\r
54 * @return true if the objects are equal.
\r
56 public boolean equals(
\r
57 final java.lang.Object obj) {
\r
61 if (super.equals(obj)==false)
\r
64 if (obj instanceof Instance) {
\r
66 Instance temp = (Instance)obj;
\r
67 if (this._urn != null) {
\r
68 if (temp._urn == null) return false;
\r
69 else if (!(this._urn.equals(temp._urn)))
\r
72 else if (temp._urn != null)
\r
80 * Returns the value of field 'urn'.
\r
82 * @return the value of field 'Urn'.
\r
84 public java.lang.String getUrn(
\r
90 * Overrides the java.lang.Object.hashCode method.
\r
92 * The following steps came from <b>Effective Java Programming
\r
93 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
95 * @return a hash code value for the object.
\r
97 public int hashCode(
\r
99 int result = super.hashCode();
\r
102 if (_urn != null) {
\r
103 result = 37 * result + _urn.hashCode();
\r
112 * @return true if this object is valid according to the schema
\r
114 public boolean isValid(
\r
118 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
128 * @throws org.exolab.castor.xml.MarshalException if object is
\r
129 * null or if any SAXException is thrown during marshaling
\r
130 * @throws org.exolab.castor.xml.ValidationException if this
\r
131 * object is an invalid instance according to the schema
\r
133 public void marshal(
\r
134 final java.io.Writer out)
\r
135 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
136 Marshaller.marshal(this, out);
\r
143 * @throws java.io.IOException if an IOException occurs during
\r
145 * @throws org.exolab.castor.xml.ValidationException if this
\r
146 * object is an invalid instance according to the schema
\r
147 * @throws org.exolab.castor.xml.MarshalException if object is
\r
148 * null or if any SAXException is thrown during marshaling
\r
150 public void marshal(
\r
151 final org.xml.sax.ContentHandler handler)
\r
152 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
153 Marshaller.marshal(this, handler);
\r
157 * Sets the value of field 'urn'.
\r
159 * @param urn the value of field 'urn'.
\r
161 public void setUrn(
\r
162 final java.lang.String urn) {
\r
167 * Method unmarshal.
\r
170 * @throws org.exolab.castor.xml.MarshalException if object is
\r
171 * null or if any SAXException is thrown during marshaling
\r
172 * @throws org.exolab.castor.xml.ValidationException if this
\r
173 * object is an invalid instance according to the schema
\r
174 * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
\r
176 public static uk.ac.vamsas.objects.core.AppData unmarshal(
\r
177 final java.io.Reader reader)
\r
178 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
179 return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Instance.class, reader);
\r
185 * @throws org.exolab.castor.xml.ValidationException if this
\r
186 * object is an invalid instance according to the schema
\r
188 public void validate(
\r
190 throws org.exolab.castor.xml.ValidationException {
\r
191 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
192 validator.validate(this);
\r