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 Property 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 _name;
\r
42 * The type specifies how the property will be parsed.
\r
43 * Empty property strings are allowed, and can be used to
\r
45 * input to a document. TODO: specify allowed types
\r
47 private java.lang.String _type;
\r
65 * Overrides the java.lang.Object.equals method.
\r
68 * @return true if the objects are equal.
\r
70 public boolean equals(
\r
71 final java.lang.Object obj) {
\r
75 if (super.equals(obj)==false)
\r
78 if (obj instanceof Property) {
\r
80 Property temp = (Property)obj;
\r
81 if (this._content != null) {
\r
82 if (temp._content == null) return false;
\r
83 else if (!(this._content.equals(temp._content)))
\r
86 else if (temp._content != null)
\r
88 if (this._name != null) {
\r
89 if (temp._name == null) return false;
\r
90 else if (!(this._name.equals(temp._name)))
\r
93 else if (temp._name != null)
\r
95 if (this._type != null) {
\r
96 if (temp._type == null) return false;
\r
97 else if (!(this._type.equals(temp._type)))
\r
100 else if (temp._type != null)
\r
108 * Returns the value of field 'content'. The field 'content'
\r
109 * has the following description: internal content storage
\r
111 * @return the value of field 'Content'.
\r
113 public java.lang.String getContent(
\r
115 return this._content;
\r
119 * Returns the value of field 'name'.
\r
121 * @return the value of field 'Name'.
\r
123 public java.lang.String getName(
\r
129 * Returns the value of field 'type'. The field 'type' has the
\r
130 * following description: The type specifies how the property
\r
132 * Empty property strings are allowed, and can be used to
\r
134 * input to a document. TODO: specify allowed types
\r
136 * @return the value of field 'Type'.
\r
138 public java.lang.String getType(
\r
144 * Overrides the java.lang.Object.hashCode method.
\r
146 * The following steps came from <b>Effective Java Programming
\r
147 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
149 * @return a hash code value for the object.
\r
151 public int hashCode(
\r
153 int result = super.hashCode();
\r
156 if (_content != null) {
\r
157 result = 37 * result + _content.hashCode();
\r
159 if (_name != null) {
\r
160 result = 37 * result + _name.hashCode();
\r
162 if (_type != null) {
\r
163 result = 37 * result + _type.hashCode();
\r
172 * @return true if this object is valid according to the schema
\r
174 public boolean isValid(
\r
178 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
188 * @throws org.exolab.castor.xml.MarshalException if object is
\r
189 * null or if any SAXException is thrown during marshaling
\r
190 * @throws org.exolab.castor.xml.ValidationException if this
\r
191 * object is an invalid instance according to the schema
\r
193 public void marshal(
\r
194 final java.io.Writer out)
\r
195 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
196 Marshaller.marshal(this, out);
\r
203 * @throws java.io.IOException if an IOException occurs during
\r
205 * @throws org.exolab.castor.xml.ValidationException if this
\r
206 * object is an invalid instance according to the schema
\r
207 * @throws org.exolab.castor.xml.MarshalException if object is
\r
208 * null or if any SAXException is thrown during marshaling
\r
210 public void marshal(
\r
211 final org.xml.sax.ContentHandler handler)
\r
212 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
213 Marshaller.marshal(this, handler);
\r
217 * Sets the value of field 'content'. The field 'content' has
\r
218 * the following description: internal content storage
\r
220 * @param content the value of field 'content'.
\r
222 public void setContent(
\r
223 final java.lang.String content) {
\r
224 this._content = content;
\r
228 * Sets the value of field 'name'.
\r
230 * @param name the value of field 'name'.
\r
232 public void setName(
\r
233 final java.lang.String name) {
\r
238 * Sets the value of field 'type'. The field 'type' has the
\r
239 * following description: The type specifies how the property
\r
241 * Empty property strings are allowed, and can be used to
\r
243 * input to a document. TODO: specify allowed types
\r
245 * @param type the value of field 'type'.
\r
247 public void setType(
\r
248 final java.lang.String type) {
\r
253 * Method unmarshal.
\r
256 * @throws org.exolab.castor.xml.MarshalException if object is
\r
257 * null or if any SAXException is thrown during marshaling
\r
258 * @throws org.exolab.castor.xml.ValidationException if this
\r
259 * object is an invalid instance according to the schema
\r
260 * @return the unmarshaled uk.ac.vamsas.objects.core.Property
\r
262 public static uk.ac.vamsas.objects.core.Property unmarshal(
\r
263 final java.io.Reader reader)
\r
264 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
265 return (uk.ac.vamsas.objects.core.Property) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Property.class, reader);
\r
271 * @throws org.exolab.castor.xml.ValidationException if this
\r
272 * object is an invalid instance according to the schema
\r
274 public void validate(
\r
276 throws org.exolab.castor.xml.ValidationException {
\r
277 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
278 validator.validate(this);
\r