View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: LINK.java,v 1.14 2007/01/04 16:26:14 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource.votable;
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.astrogrid.registry.beans.resource.votable.types.LINKContentRoleType;
19  import org.exolab.castor.xml.MarshalException;
20  import org.exolab.castor.xml.Marshaller;
21  import org.exolab.castor.xml.Unmarshaller;
22  import org.exolab.castor.xml.ValidationException;
23  import org.xml.sax.ContentHandler;
24  
25  /***
26   * Class LINK.
27   * 
28   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:14 $
29   */
30  public class LINK extends org.astrogrid.common.bean.BaseBean 
31  implements java.io.Serializable
32  {
33  
34  
35        //--------------------------/
36       //- Class/Member Variables -/
37      //--------------------------/
38  
39      /***
40       * internal content storage
41       */
42      private java.lang.String _content = "";
43  
44      /***
45       * Field _ID
46       */
47      private java.lang.String _ID;
48  
49      /***
50       * Field _contentRole
51       */
52      private org.astrogrid.registry.beans.resource.votable.types.LINKContentRoleType _contentRole;
53  
54      /***
55       * Field _contentType
56       */
57      private java.lang.String _contentType;
58  
59      /***
60       * Field _title
61       */
62      private java.lang.String _title;
63  
64      /***
65       * Field _value
66       */
67      private java.lang.String _value;
68  
69      /***
70       * Field _href
71       */
72      private java.lang.String _href;
73  
74      /***
75       * Field _gref
76       */
77      private java.lang.String _gref;
78  
79      /***
80       * Field _action
81       */
82      private java.lang.String _action;
83  
84  
85        //----------------/
86       //- Constructors -/
87      //----------------/
88  
89      public LINK() {
90          super();
91          setContent("");
92      } //-- org.astrogrid.registry.beans.resource.votable.LINK()
93  
94  
95        //-----------/
96       //- Methods -/
97      //-----------/
98  
99      /***
100      * Note: hashCode() has not been overriden
101      * 
102      * @param obj
103      */
104     public boolean equals(java.lang.Object obj)
105     {
106         if ( this == obj )
107             return true;
108         
109         if (super.equals(obj)==false)
110             return false;
111         
112         if (obj instanceof LINK) {
113         
114             LINK temp = (LINK)obj;
115             if (this._content != null) {
116                 if (temp._content == null) return false;
117                 else if (!(this._content.equals(temp._content))) 
118                     return false;
119             }
120             else if (temp._content != null)
121                 return false;
122             if (this._ID != null) {
123                 if (temp._ID == null) return false;
124                 else if (!(this._ID.equals(temp._ID))) 
125                     return false;
126             }
127             else if (temp._ID != null)
128                 return false;
129             if (this._contentRole != null) {
130                 if (temp._contentRole == null) return false;
131                 else if (!(this._contentRole.equals(temp._contentRole))) 
132                     return false;
133             }
134             else if (temp._contentRole != null)
135                 return false;
136             if (this._contentType != null) {
137                 if (temp._contentType == null) return false;
138                 else if (!(this._contentType.equals(temp._contentType))) 
139                     return false;
140             }
141             else if (temp._contentType != null)
142                 return false;
143             if (this._title != null) {
144                 if (temp._title == null) return false;
145                 else if (!(this._title.equals(temp._title))) 
146                     return false;
147             }
148             else if (temp._title != null)
149                 return false;
150             if (this._value != null) {
151                 if (temp._value == null) return false;
152                 else if (!(this._value.equals(temp._value))) 
153                     return false;
154             }
155             else if (temp._value != null)
156                 return false;
157             if (this._href != null) {
158                 if (temp._href == null) return false;
159                 else if (!(this._href.equals(temp._href))) 
160                     return false;
161             }
162             else if (temp._href != null)
163                 return false;
164             if (this._gref != null) {
165                 if (temp._gref == null) return false;
166                 else if (!(this._gref.equals(temp._gref))) 
167                     return false;
168             }
169             else if (temp._gref != null)
170                 return false;
171             if (this._action != null) {
172                 if (temp._action == null) return false;
173                 else if (!(this._action.equals(temp._action))) 
174                     return false;
175             }
176             else if (temp._action != null)
177                 return false;
178             return true;
179         }
180         return false;
181     } //-- boolean equals(java.lang.Object) 
182 
183     /***
184      * Returns the value of field 'action'.
185      * 
186      * @return the value of field 'action'.
187      */
188     public java.lang.String getAction()
189     {
190         return this._action;
191     } //-- java.lang.String getAction() 
192 
193     /***
194      * Returns the value of field 'content'. The field 'content'
195      * has the following description: internal content storage
196      * 
197      * @return the value of field 'content'.
198      */
199     public java.lang.String getContent()
200     {
201         return this._content;
202     } //-- java.lang.String getContent() 
203 
204     /***
205      * Returns the value of field 'contentRole'.
206      * 
207      * @return the value of field 'contentRole'.
208      */
209     public org.astrogrid.registry.beans.resource.votable.types.LINKContentRoleType getContentRole()
210     {
211         return this._contentRole;
212     } //-- org.astrogrid.registry.beans.resource.votable.types.LINKContentRoleType getContentRole() 
213 
214     /***
215      * Returns the value of field 'contentType'.
216      * 
217      * @return the value of field 'contentType'.
218      */
219     public java.lang.String getContentType()
220     {
221         return this._contentType;
222     } //-- java.lang.String getContentType() 
223 
224     /***
225      * Returns the value of field 'gref'.
226      * 
227      * @return the value of field 'gref'.
228      */
229     public java.lang.String getGref()
230     {
231         return this._gref;
232     } //-- java.lang.String getGref() 
233 
234     /***
235      * Returns the value of field 'href'.
236      * 
237      * @return the value of field 'href'.
238      */
239     public java.lang.String getHref()
240     {
241         return this._href;
242     } //-- java.lang.String getHref() 
243 
244     /***
245      * Returns the value of field 'ID'.
246      * 
247      * @return the value of field 'ID'.
248      */
249     public java.lang.String getID()
250     {
251         return this._ID;
252     } //-- java.lang.String getID() 
253 
254     /***
255      * Returns the value of field 'title'.
256      * 
257      * @return the value of field 'title'.
258      */
259     public java.lang.String getTitle()
260     {
261         return this._title;
262     } //-- java.lang.String getTitle() 
263 
264     /***
265      * Returns the value of field 'value'.
266      * 
267      * @return the value of field 'value'.
268      */
269     public java.lang.String getValue()
270     {
271         return this._value;
272     } //-- java.lang.String getValue() 
273 
274     /***
275      * Method isValid
276      */
277     public boolean isValid()
278     {
279         try {
280             validate();
281         }
282         catch (org.exolab.castor.xml.ValidationException vex) {
283             return false;
284         }
285         return true;
286     } //-- boolean isValid() 
287 
288     /***
289      * Method marshal
290      * 
291      * @param out
292      */
293     public void marshal(java.io.Writer out)
294         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
295     {
296         
297         Marshaller.marshal(this, out);
298     } //-- void marshal(java.io.Writer) 
299 
300     /***
301      * Method marshal
302      * 
303      * @param handler
304      */
305     public void marshal(org.xml.sax.ContentHandler handler)
306         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
307     {
308         
309         Marshaller.marshal(this, handler);
310     } //-- void marshal(org.xml.sax.ContentHandler) 
311 
312     /***
313      * Sets the value of field 'action'.
314      * 
315      * @param action the value of field 'action'.
316      */
317     public void setAction(java.lang.String action)
318     {
319         this._action = action;
320     } //-- void setAction(java.lang.String) 
321 
322     /***
323      * Sets the value of field 'content'. The field 'content' has
324      * the following description: internal content storage
325      * 
326      * @param content the value of field 'content'.
327      */
328     public void setContent(java.lang.String content)
329     {
330         this._content = content;
331     } //-- void setContent(java.lang.String) 
332 
333     /***
334      * Sets the value of field 'contentRole'.
335      * 
336      * @param contentRole the value of field 'contentRole'.
337      */
338     public void setContentRole(org.astrogrid.registry.beans.resource.votable.types.LINKContentRoleType contentRole)
339     {
340         this._contentRole = contentRole;
341     } //-- void setContentRole(org.astrogrid.registry.beans.resource.votable.types.LINKContentRoleType) 
342 
343     /***
344      * Sets the value of field 'contentType'.
345      * 
346      * @param contentType the value of field 'contentType'.
347      */
348     public void setContentType(java.lang.String contentType)
349     {
350         this._contentType = contentType;
351     } //-- void setContentType(java.lang.String) 
352 
353     /***
354      * Sets the value of field 'gref'.
355      * 
356      * @param gref the value of field 'gref'.
357      */
358     public void setGref(java.lang.String gref)
359     {
360         this._gref = gref;
361     } //-- void setGref(java.lang.String) 
362 
363     /***
364      * Sets the value of field 'href'.
365      * 
366      * @param href the value of field 'href'.
367      */
368     public void setHref(java.lang.String href)
369     {
370         this._href = href;
371     } //-- void setHref(java.lang.String) 
372 
373     /***
374      * Sets the value of field 'ID'.
375      * 
376      * @param ID the value of field 'ID'.
377      */
378     public void setID(java.lang.String ID)
379     {
380         this._ID = ID;
381     } //-- void setID(java.lang.String) 
382 
383     /***
384      * Sets the value of field 'title'.
385      * 
386      * @param title the value of field 'title'.
387      */
388     public void setTitle(java.lang.String title)
389     {
390         this._title = title;
391     } //-- void setTitle(java.lang.String) 
392 
393     /***
394      * Sets the value of field 'value'.
395      * 
396      * @param value the value of field 'value'.
397      */
398     public void setValue(java.lang.String value)
399     {
400         this._value = value;
401     } //-- void setValue(java.lang.String) 
402 
403     /***
404      * Method unmarshalLINK
405      * 
406      * @param reader
407      */
408     public static org.astrogrid.registry.beans.resource.votable.LINK unmarshalLINK(java.io.Reader reader)
409         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
410     {
411         return (org.astrogrid.registry.beans.resource.votable.LINK) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.votable.LINK.class, reader);
412     } //-- org.astrogrid.registry.beans.resource.votable.LINK unmarshalLINK(java.io.Reader) 
413 
414     /***
415      * Method validate
416      */
417     public void validate()
418         throws org.exolab.castor.xml.ValidationException
419     {
420         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
421         validator.validate(this);
422     } //-- void validate() 
423 
424 }