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: STREAM.java,v 1.14 2007/01/04 16:26:13 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 java.util.Date;
19  import org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType;
20  import org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType;
21  import org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType;
22  import org.exolab.castor.xml.MarshalException;
23  import org.exolab.castor.xml.Marshaller;
24  import org.exolab.castor.xml.Unmarshaller;
25  import org.exolab.castor.xml.ValidationException;
26  import org.xml.sax.ContentHandler;
27  
28  /***
29   * Class STREAM.
30   * 
31   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:13 $
32   */
33  public class STREAM extends org.astrogrid.common.bean.BaseBean 
34  implements java.io.Serializable
35  {
36  
37  
38        //--------------------------/
39       //- Class/Member Variables -/
40      //--------------------------/
41  
42      /***
43       * internal content storage
44       */
45      private java.lang.String _content = "";
46  
47      /***
48       * Field _type
49       */
50      private org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType _type = org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType.valueOf("locator");
51  
52      /***
53       * Field _href
54       */
55      private java.lang.String _href;
56  
57      /***
58       * Field _actuate
59       */
60      private org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType _actuate = org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType.valueOf("onRequest");
61  
62      /***
63       * Field _encoding
64       */
65      private org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType _encoding = org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType.valueOf("none");
66  
67      /***
68       * Field _expires
69       */
70      private java.util.Date _expires;
71  
72      /***
73       * Field _rights
74       */
75      private java.lang.String _rights;
76  
77  
78        //----------------/
79       //- Constructors -/
80      //----------------/
81  
82      public STREAM() {
83          super();
84          setContent("");
85          setType(org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType.valueOf("locator"));
86          setActuate(org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType.valueOf("onRequest"));
87          setEncoding(org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType.valueOf("none"));
88      } //-- org.astrogrid.registry.beans.resource.votable.STREAM()
89  
90  
91        //-----------/
92       //- Methods -/
93      //-----------/
94  
95      /***
96       * Note: hashCode() has not been overriden
97       * 
98       * @param obj
99       */
100     public boolean equals(java.lang.Object obj)
101     {
102         if ( this == obj )
103             return true;
104         
105         if (super.equals(obj)==false)
106             return false;
107         
108         if (obj instanceof STREAM) {
109         
110             STREAM temp = (STREAM)obj;
111             if (this._content != null) {
112                 if (temp._content == null) return false;
113                 else if (!(this._content.equals(temp._content))) 
114                     return false;
115             }
116             else if (temp._content != null)
117                 return false;
118             if (this._type != null) {
119                 if (temp._type == null) return false;
120                 else if (!(this._type.equals(temp._type))) 
121                     return false;
122             }
123             else if (temp._type != null)
124                 return false;
125             if (this._href != null) {
126                 if (temp._href == null) return false;
127                 else if (!(this._href.equals(temp._href))) 
128                     return false;
129             }
130             else if (temp._href != null)
131                 return false;
132             if (this._actuate != null) {
133                 if (temp._actuate == null) return false;
134                 else if (!(this._actuate.equals(temp._actuate))) 
135                     return false;
136             }
137             else if (temp._actuate != null)
138                 return false;
139             if (this._encoding != null) {
140                 if (temp._encoding == null) return false;
141                 else if (!(this._encoding.equals(temp._encoding))) 
142                     return false;
143             }
144             else if (temp._encoding != null)
145                 return false;
146             if (this._expires != null) {
147                 if (temp._expires == null) return false;
148                 else if (!(this._expires.equals(temp._expires))) 
149                     return false;
150             }
151             else if (temp._expires != null)
152                 return false;
153             if (this._rights != null) {
154                 if (temp._rights == null) return false;
155                 else if (!(this._rights.equals(temp._rights))) 
156                     return false;
157             }
158             else if (temp._rights != null)
159                 return false;
160             return true;
161         }
162         return false;
163     } //-- boolean equals(java.lang.Object) 
164 
165     /***
166      * Returns the value of field 'actuate'.
167      * 
168      * @return the value of field 'actuate'.
169      */
170     public org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType getActuate()
171     {
172         return this._actuate;
173     } //-- org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType getActuate() 
174 
175     /***
176      * Returns the value of field 'content'. The field 'content'
177      * has the following description: internal content storage
178      * 
179      * @return the value of field 'content'.
180      */
181     public java.lang.String getContent()
182     {
183         return this._content;
184     } //-- java.lang.String getContent() 
185 
186     /***
187      * Returns the value of field 'encoding'.
188      * 
189      * @return the value of field 'encoding'.
190      */
191     public org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType getEncoding()
192     {
193         return this._encoding;
194     } //-- org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType getEncoding() 
195 
196     /***
197      * Returns the value of field 'expires'.
198      * 
199      * @return the value of field 'expires'.
200      */
201     public java.util.Date getExpires()
202     {
203         return this._expires;
204     } //-- java.util.Date getExpires() 
205 
206     /***
207      * Returns the value of field 'href'.
208      * 
209      * @return the value of field 'href'.
210      */
211     public java.lang.String getHref()
212     {
213         return this._href;
214     } //-- java.lang.String getHref() 
215 
216     /***
217      * Returns the value of field 'rights'.
218      * 
219      * @return the value of field 'rights'.
220      */
221     public java.lang.String getRights()
222     {
223         return this._rights;
224     } //-- java.lang.String getRights() 
225 
226     /***
227      * Returns the value of field 'type'.
228      * 
229      * @return the value of field 'type'.
230      */
231     public org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType getType()
232     {
233         return this._type;
234     } //-- org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType getType() 
235 
236     /***
237      * Method isValid
238      */
239     public boolean isValid()
240     {
241         try {
242             validate();
243         }
244         catch (org.exolab.castor.xml.ValidationException vex) {
245             return false;
246         }
247         return true;
248     } //-- boolean isValid() 
249 
250     /***
251      * Method marshal
252      * 
253      * @param out
254      */
255     public void marshal(java.io.Writer out)
256         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
257     {
258         
259         Marshaller.marshal(this, out);
260     } //-- void marshal(java.io.Writer) 
261 
262     /***
263      * Method marshal
264      * 
265      * @param handler
266      */
267     public void marshal(org.xml.sax.ContentHandler handler)
268         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
269     {
270         
271         Marshaller.marshal(this, handler);
272     } //-- void marshal(org.xml.sax.ContentHandler) 
273 
274     /***
275      * Sets the value of field 'actuate'.
276      * 
277      * @param actuate the value of field 'actuate'.
278      */
279     public void setActuate(org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType actuate)
280     {
281         this._actuate = actuate;
282     } //-- void setActuate(org.astrogrid.registry.beans.resource.votable.types.STREAMActuateType) 
283 
284     /***
285      * Sets the value of field 'content'. The field 'content' has
286      * the following description: internal content storage
287      * 
288      * @param content the value of field 'content'.
289      */
290     public void setContent(java.lang.String content)
291     {
292         this._content = content;
293     } //-- void setContent(java.lang.String) 
294 
295     /***
296      * Sets the value of field 'encoding'.
297      * 
298      * @param encoding the value of field 'encoding'.
299      */
300     public void setEncoding(org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType encoding)
301     {
302         this._encoding = encoding;
303     } //-- void setEncoding(org.astrogrid.registry.beans.resource.votable.types.STREAMEncodingType) 
304 
305     /***
306      * Sets the value of field 'expires'.
307      * 
308      * @param expires the value of field 'expires'.
309      */
310     public void setExpires(java.util.Date expires)
311     {
312         this._expires = expires;
313     } //-- void setExpires(java.util.Date) 
314 
315     /***
316      * Sets the value of field 'href'.
317      * 
318      * @param href the value of field 'href'.
319      */
320     public void setHref(java.lang.String href)
321     {
322         this._href = href;
323     } //-- void setHref(java.lang.String) 
324 
325     /***
326      * Sets the value of field 'rights'.
327      * 
328      * @param rights the value of field 'rights'.
329      */
330     public void setRights(java.lang.String rights)
331     {
332         this._rights = rights;
333     } //-- void setRights(java.lang.String) 
334 
335     /***
336      * Sets the value of field 'type'.
337      * 
338      * @param type the value of field 'type'.
339      */
340     public void setType(org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType type)
341     {
342         this._type = type;
343     } //-- void setType(org.astrogrid.registry.beans.resource.votable.types.STREAMTypeType) 
344 
345     /***
346      * Method unmarshalSTREAM
347      * 
348      * @param reader
349      */
350     public static org.astrogrid.registry.beans.resource.votable.STREAM unmarshalSTREAM(java.io.Reader reader)
351         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
352     {
353         return (org.astrogrid.registry.beans.resource.votable.STREAM) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.votable.STREAM.class, reader);
354     } //-- org.astrogrid.registry.beans.resource.votable.STREAM unmarshalSTREAM(java.io.Reader) 
355 
356     /***
357      * Method validate
358      */
359     public void validate()
360         throws org.exolab.castor.xml.ValidationException
361     {
362         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
363         validator.validate(this);
364     } //-- void validate() 
365 
366 }