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 Link extends uk.ac.vamsas.client.Vobject
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * internal content storage
\r
34 private java.lang.String _content = "";
\r
39 private java.lang.String _href;
\r
57 * Overrides the java.lang.Object.equals method.
\r
60 * @return true if the objects are equal.
\r
62 public boolean equals(
\r
63 final java.lang.Object obj) {
\r
67 if (super.equals(obj)==false)
\r
70 if (obj instanceof Link) {
\r
72 Link temp = (Link)obj;
\r
73 if (this._content != null) {
\r
74 if (temp._content == null) return false;
\r
75 else if (!(this._content.equals(temp._content)))
\r
78 else if (temp._content != null)
\r
80 if (this._href != null) {
\r
81 if (temp._href == null) return false;
\r
82 else if (!(this._href.equals(temp._href)))
\r
85 else if (temp._href != null)
\r
93 * Returns the value of field 'content'. The field 'content'
\r
94 * has the following description: internal content storage
\r
96 * @return the value of field 'Content'.
\r
98 public java.lang.String getContent(
\r
100 return this._content;
\r
104 * Returns the value of field 'href'. The field 'href' has the
\r
105 * following description: The URI
\r
107 * @return the value of field 'Href'.
\r
109 public java.lang.String getHref(
\r
115 * Overrides the java.lang.Object.hashCode method.
\r
117 * The following steps came from <b>Effective Java Programming
\r
118 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
120 * @return a hash code value for the object.
\r
122 public int hashCode(
\r
124 int result = super.hashCode();
\r
127 if (_content != null) {
\r
128 result = 37 * result + _content.hashCode();
\r
130 if (_href != null) {
\r
131 result = 37 * result + _href.hashCode();
\r
140 * @return true if this object is valid according to the schema
\r
142 public boolean isValid(
\r
146 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
156 * @throws org.exolab.castor.xml.MarshalException if object is
\r
157 * null or if any SAXException is thrown during marshaling
\r
158 * @throws org.exolab.castor.xml.ValidationException if this
\r
159 * object is an invalid instance according to the schema
\r
161 public void marshal(
\r
162 final java.io.Writer out)
\r
163 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
164 Marshaller.marshal(this, out);
\r
171 * @throws java.io.IOException if an IOException occurs during
\r
173 * @throws org.exolab.castor.xml.ValidationException if this
\r
174 * object is an invalid instance according to the schema
\r
175 * @throws org.exolab.castor.xml.MarshalException if object is
\r
176 * null or if any SAXException is thrown during marshaling
\r
178 public void marshal(
\r
179 final org.xml.sax.ContentHandler handler)
\r
180 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
181 Marshaller.marshal(this, handler);
\r
185 * Sets the value of field 'content'. The field 'content' has
\r
186 * the following description: internal content storage
\r
188 * @param content the value of field 'content'.
\r
190 public void setContent(
\r
191 final java.lang.String content) {
\r
192 this._content = content;
\r
196 * Sets the value of field 'href'. The field 'href' has the
\r
197 * following description: The URI
\r
199 * @param href the value of field 'href'.
\r
201 public void setHref(
\r
202 final java.lang.String href) {
\r
207 * Method unmarshal.
\r
210 * @throws org.exolab.castor.xml.MarshalException if object is
\r
211 * null or if any SAXException is thrown during marshaling
\r
212 * @throws org.exolab.castor.xml.ValidationException if this
\r
213 * object is an invalid instance according to the schema
\r
214 * @return the unmarshaled uk.ac.vamsas.objects.core.Link
\r
216 public static uk.ac.vamsas.objects.core.Link unmarshal(
\r
217 final java.io.Reader reader)
\r
218 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
219 return (uk.ac.vamsas.objects.core.Link) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Link.class, reader);
\r
225 * @throws org.exolab.castor.xml.ValidationException if this
\r
226 * object is an invalid instance according to the schema
\r
228 public void validate(
\r
230 throws org.exolab.castor.xml.ValidationException {
\r
231 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
232 validator.validate(this);
\r