9d798eee3379ee18377a725ea27f52e63d928a5f
[vamsas.git] / src / org / vamsas / objects / core / Link.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.Marshaller;
20 import org.exolab.castor.xml.Unmarshaller;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.ContentHandler;
23
24 /**
25  * Class Link.
26  * 
27  * @version $Revision$ $Date$
28  */
29 public class Link extends org.vamsas.client.Vobject 
30 implements java.io.Serializable
31 {
32
33
34       //--------------------------/
35      //- Class/Member Variables -/
36     //--------------------------/
37
38     /**
39      * internal content storage
40      */
41     private java.lang.String _content = "";
42
43     /**
44      * The URI
45      */
46     private java.lang.String _href;
47
48
49       //----------------/
50      //- Constructors -/
51     //----------------/
52
53     public Link() 
54      {
55         super();
56         setContent("");
57     } //-- org.vamsas.objects.core.Link()
58
59
60       //-----------/
61      //- Methods -/
62     //-----------/
63
64     /**
65      * Note: hashCode() has not been overriden
66      * 
67      * @param obj
68      * @return boolean
69      */
70     public boolean equals(java.lang.Object obj)
71     {
72         if ( this == obj )
73             return true;
74         
75         if (super.equals(obj)==false)
76             return false;
77         
78         if (obj instanceof Link) {
79         
80             Link temp = (Link)obj;
81             if (this._content != null) {
82                 if (temp._content == null) return false;
83                 else if (!(this._content.equals(temp._content))) 
84                     return false;
85             }
86             else if (temp._content != null)
87                 return false;
88             if (this._href != null) {
89                 if (temp._href == null) return false;
90                 else if (!(this._href.equals(temp._href))) 
91                     return false;
92             }
93             else if (temp._href != null)
94                 return false;
95             return true;
96         }
97         return false;
98     } //-- boolean equals(java.lang.Object) 
99
100     /**
101      * Returns the value of field 'content'. The field 'content'
102      * has the following description: internal content storage
103      * 
104      * @return String
105      * @return the value of field 'content'.
106      */
107     public java.lang.String getContent()
108     {
109         return this._content;
110     } //-- java.lang.String getContent() 
111
112     /**
113      * Returns the value of field 'href'. The field 'href' has the
114      * following description: The URI
115      * 
116      * @return String
117      * @return the value of field 'href'.
118      */
119     public java.lang.String getHref()
120     {
121         return this._href;
122     } //-- java.lang.String getHref() 
123
124     /**
125      * Method isValid
126      * 
127      * 
128      * 
129      * @return boolean
130      */
131     public boolean isValid()
132     {
133         try {
134             validate();
135         }
136         catch (org.exolab.castor.xml.ValidationException vex) {
137             return false;
138         }
139         return true;
140     } //-- boolean isValid() 
141
142     /**
143      * Method marshal
144      * 
145      * 
146      * 
147      * @param out
148      */
149     public void marshal(java.io.Writer out)
150         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
151     {
152         
153         Marshaller.marshal(this, out);
154     } //-- void marshal(java.io.Writer) 
155
156     /**
157      * Method marshal
158      * 
159      * 
160      * 
161      * @param handler
162      */
163     public void marshal(org.xml.sax.ContentHandler handler)
164         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
165     {
166         
167         Marshaller.marshal(this, handler);
168     } //-- void marshal(org.xml.sax.ContentHandler) 
169
170     /**
171      * Sets the value of field 'content'. The field 'content' has
172      * the following description: internal content storage
173      * 
174      * @param content the value of field 'content'.
175      */
176     public void setContent(java.lang.String content)
177     {
178         this._content = content;
179     } //-- void setContent(java.lang.String) 
180
181     /**
182      * Sets the value of field 'href'. The field 'href' has the
183      * following description: The URI
184      * 
185      * @param href the value of field 'href'.
186      */
187     public void setHref(java.lang.String href)
188     {
189         this._href = href;
190     } //-- void setHref(java.lang.String) 
191
192     /**
193      * Method unmarshal
194      * 
195      * 
196      * 
197      * @param reader
198      * @return Link
199      */
200     public static org.vamsas.objects.core.Link unmarshal(java.io.Reader reader)
201         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
202     {
203         return (org.vamsas.objects.core.Link) Unmarshaller.unmarshal(org.vamsas.objects.core.Link.class, reader);
204     } //-- org.vamsas.objects.core.Link unmarshal(java.io.Reader) 
205
206     /**
207      * Method validate
208      * 
209      */
210     public void validate()
211         throws org.exolab.castor.xml.ValidationException
212     {
213         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
214         validator.validate(this);
215     } //-- void validate() 
216
217 }