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
83 if (this._content != null) {
\r
84 if (temp._content == null) return false;
\r
85 if (this._content != temp._content) {
\r
86 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
\r
87 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
\r
88 if (thcycle!=tmcycle) {
\r
89 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
\r
90 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
\r
94 if (!this._content.equals(temp._content)) {
\r
95 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
\r
96 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
\r
99 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
\r
100 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
\r
103 } else if (temp._content != null)
\r
105 if (this._name != null) {
\r
106 if (temp._name == null) return false;
\r
107 if (this._name != temp._name) {
\r
108 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
\r
109 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
\r
110 if (thcycle!=tmcycle) {
\r
111 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
\r
112 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
\r
116 if (!this._name.equals(temp._name)) {
\r
117 org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
\r
118 org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
\r
121 org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
\r
122 org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
\r
125 } else if (temp._name != null)
\r
127 if (this._type != null) {
\r
128 if (temp._type == null) return false;
\r
129 if (this._type != temp._type) {
\r
130 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type);
\r
131 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type);
\r
132 if (thcycle!=tmcycle) {
\r
133 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); };
\r
134 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); };
\r
138 if (!this._type.equals(temp._type)) {
\r
139 org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
\r
140 org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
\r
143 org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
\r
144 org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
\r
147 } else if (temp._type != null)
\r
155 * Returns the value of field 'content'. The field 'content'
\r
156 * has the following description: internal content storage
\r
158 * @return the value of field 'Content'.
\r
160 public java.lang.String getContent(
\r
162 return this._content;
\r
166 * Returns the value of field 'name'.
\r
168 * @return the value of field 'Name'.
\r
170 public java.lang.String getName(
\r
176 * Returns the value of field 'type'. The field 'type' has the
\r
177 * following description: The type specifies how the property
\r
179 * Empty property strings are allowed, and can be used to
\r
181 * input to a document. TODO: specify allowed types
\r
183 * @return the value of field 'Type'.
\r
185 public java.lang.String getType(
\r
191 * Overrides the java.lang.Object.hashCode method.
\r
193 * The following steps came from <b>Effective Java Programming
\r
194 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
196 * @return a hash code value for the object.
\r
198 public int hashCode(
\r
200 int result = super.hashCode();
\r
203 if (_content != null
\r
204 && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
\r
205 result = 37 * result + _content.hashCode();
\r
206 org.castor.util.CycleBreaker.releaseCycleHandle(_content);
\r
209 && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
\r
210 result = 37 * result + _name.hashCode();
\r
211 org.castor.util.CycleBreaker.releaseCycleHandle(_name);
\r
214 && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
\r
215 result = 37 * result + _type.hashCode();
\r
216 org.castor.util.CycleBreaker.releaseCycleHandle(_type);
\r
225 * @return true if this object is valid according to the schema
\r
227 public boolean isValid(
\r
231 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
241 * @throws org.exolab.castor.xml.MarshalException if object is
\r
242 * null or if any SAXException is thrown during marshaling
\r
243 * @throws org.exolab.castor.xml.ValidationException if this
\r
244 * object is an invalid instance according to the schema
\r
246 public void marshal(
\r
247 final java.io.Writer out)
\r
248 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
249 Marshaller.marshal(this, out);
\r
256 * @throws java.io.IOException if an IOException occurs during
\r
258 * @throws org.exolab.castor.xml.ValidationException if this
\r
259 * object is an invalid instance according to the schema
\r
260 * @throws org.exolab.castor.xml.MarshalException if object is
\r
261 * null or if any SAXException is thrown during marshaling
\r
263 public void marshal(
\r
264 final org.xml.sax.ContentHandler handler)
\r
265 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
266 Marshaller.marshal(this, handler);
\r
270 * Sets the value of field 'content'. The field 'content' has
\r
271 * the following description: internal content storage
\r
273 * @param content the value of field 'content'.
\r
275 public void setContent(
\r
276 final java.lang.String content) {
\r
277 this._content = content;
\r
281 * Sets the value of field 'name'.
\r
283 * @param name the value of field 'name'.
\r
285 public void setName(
\r
286 final java.lang.String name) {
\r
291 * Sets the value of field 'type'. The field 'type' has the
\r
292 * following description: The type specifies how the property
\r
294 * Empty property strings are allowed, and can be used to
\r
296 * input to a document. TODO: specify allowed types
\r
298 * @param type the value of field 'type'.
\r
300 public void setType(
\r
301 final java.lang.String type) {
\r
306 * Method unmarshal.
\r
309 * @throws org.exolab.castor.xml.MarshalException if object is
\r
310 * null or if any SAXException is thrown during marshaling
\r
311 * @throws org.exolab.castor.xml.ValidationException if this
\r
312 * object is an invalid instance according to the schema
\r
313 * @return the unmarshaled uk.ac.vamsas.objects.core.Property
\r
315 public static uk.ac.vamsas.objects.core.Property unmarshal(
\r
316 final java.io.Reader reader)
\r
317 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
318 return (uk.ac.vamsas.objects.core.Property) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Property.class, reader);
\r
324 * @throws org.exolab.castor.xml.ValidationException if this
\r
325 * object is an invalid instance according to the schema
\r
327 public void validate(
\r
329 throws org.exolab.castor.xml.ValidationException {
\r
330 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
331 validator.validate(this);
\r