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: SummaryType.java,v 1.14 2007/01/04 16:26:22 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource;
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 SummaryType.
26   * 
27   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:22 $
28   */
29  public class SummaryType extends org.astrogrid.common.bean.BaseBean 
30  implements java.io.Serializable
31  {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /***
39       * An account of the nature of the resource
40       *  
41       */
42      private java.lang.String _description;
43  
44      /***
45       * URL pointing to a human-readable document describing this 
46       *  resource. 
47       *  
48       */
49      private java.lang.String _referenceURL;
50  
51      /***
52       * a bibliographic reference from which the present resource is
53       * 
54       *  derived or extracted. 
55       *  
56       */
57      private org.astrogrid.registry.beans.resource.SourceType _source;
58  
59  
60        //----------------/
61       //- Constructors -/
62      //----------------/
63  
64      public SummaryType() {
65          super();
66      } //-- org.astrogrid.registry.beans.resource.SummaryType()
67  
68  
69        //-----------/
70       //- Methods -/
71      //-----------/
72  
73      /***
74       * Note: hashCode() has not been overriden
75       * 
76       * @param obj
77       */
78      public boolean equals(java.lang.Object obj)
79      {
80          if ( this == obj )
81              return true;
82          
83          if (super.equals(obj)==false)
84              return false;
85          
86          if (obj instanceof SummaryType) {
87          
88              SummaryType temp = (SummaryType)obj;
89              if (this._description != null) {
90                  if (temp._description == null) return false;
91                  else if (!(this._description.equals(temp._description))) 
92                      return false;
93              }
94              else if (temp._description != null)
95                  return false;
96              if (this._referenceURL != null) {
97                  if (temp._referenceURL == null) return false;
98                  else if (!(this._referenceURL.equals(temp._referenceURL))) 
99                      return false;
100             }
101             else if (temp._referenceURL != null)
102                 return false;
103             if (this._source != null) {
104                 if (temp._source == null) return false;
105                 else if (!(this._source.equals(temp._source))) 
106                     return false;
107             }
108             else if (temp._source != null)
109                 return false;
110             return true;
111         }
112         return false;
113     } //-- boolean equals(java.lang.Object) 
114 
115     /***
116      * Returns the value of field 'description'. The field
117      * 'description' has the following description: An account of
118      * the nature of the resource
119      *  
120      * 
121      * @return the value of field 'description'.
122      */
123     public java.lang.String getDescription()
124     {
125         return this._description;
126     } //-- java.lang.String getDescription() 
127 
128     /***
129      * Returns the value of field 'referenceURL'. The field
130      * 'referenceURL' has the following description: URL pointing
131      * to a human-readable document describing this 
132      *  resource. 
133      *  
134      * 
135      * @return the value of field 'referenceURL'.
136      */
137     public java.lang.String getReferenceURL()
138     {
139         return this._referenceURL;
140     } //-- java.lang.String getReferenceURL() 
141 
142     /***
143      * Returns the value of field 'source'. The field 'source' has
144      * the following description: a bibliographic reference from
145      * which the present resource is 
146      *  derived or extracted. 
147      *  
148      * 
149      * @return the value of field 'source'.
150      */
151     public org.astrogrid.registry.beans.resource.SourceType getSource()
152     {
153         return this._source;
154     } //-- org.astrogrid.registry.beans.resource.SourceType getSource() 
155 
156     /***
157      * Method isValid
158      */
159     public boolean isValid()
160     {
161         try {
162             validate();
163         }
164         catch (org.exolab.castor.xml.ValidationException vex) {
165             return false;
166         }
167         return true;
168     } //-- boolean isValid() 
169 
170     /***
171      * Method marshal
172      * 
173      * @param out
174      */
175     public void marshal(java.io.Writer out)
176         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
177     {
178         
179         Marshaller.marshal(this, out);
180     } //-- void marshal(java.io.Writer) 
181 
182     /***
183      * Method marshal
184      * 
185      * @param handler
186      */
187     public void marshal(org.xml.sax.ContentHandler handler)
188         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
189     {
190         
191         Marshaller.marshal(this, handler);
192     } //-- void marshal(org.xml.sax.ContentHandler) 
193 
194     /***
195      * Sets the value of field 'description'. The field
196      * 'description' has the following description: An account of
197      * the nature of the resource
198      *  
199      * 
200      * @param description the value of field 'description'.
201      */
202     public void setDescription(java.lang.String description)
203     {
204         this._description = description;
205     } //-- void setDescription(java.lang.String) 
206 
207     /***
208      * Sets the value of field 'referenceURL'. The field
209      * 'referenceURL' has the following description: URL pointing
210      * to a human-readable document describing this 
211      *  resource. 
212      *  
213      * 
214      * @param referenceURL the value of field 'referenceURL'.
215      */
216     public void setReferenceURL(java.lang.String referenceURL)
217     {
218         this._referenceURL = referenceURL;
219     } //-- void setReferenceURL(java.lang.String) 
220 
221     /***
222      * Sets the value of field 'source'. The field 'source' has the
223      * following description: a bibliographic reference from which
224      * the present resource is 
225      *  derived or extracted. 
226      *  
227      * 
228      * @param source the value of field 'source'.
229      */
230     public void setSource(org.astrogrid.registry.beans.resource.SourceType source)
231     {
232         this._source = source;
233     } //-- void setSource(org.astrogrid.registry.beans.resource.SourceType) 
234 
235     /***
236      * Method unmarshalSummaryType
237      * 
238      * @param reader
239      */
240     public static org.astrogrid.registry.beans.resource.SummaryType unmarshalSummaryType(java.io.Reader reader)
241         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
242     {
243         return (org.astrogrid.registry.beans.resource.SummaryType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.SummaryType.class, reader);
244     } //-- org.astrogrid.registry.beans.resource.SummaryType unmarshalSummaryType(java.io.Reader) 
245 
246     /***
247      * Method validate
248      */
249     public void validate()
250         throws org.exolab.castor.xml.ValidationException
251     {
252         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
253         validator.validate(this);
254     } //-- void validate() 
255 
256 }