autogenerated java classes for current schema
[vamsas.git] / src / org / vamsas / objects / core / Uri.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  * Primitive labelled URI object
26  *  
27  * 
28  * @version $Revision$ $Date$
29  */
30 public class Uri extends org.vamsas.client.Vobject 
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      * The URI
46      */
47     private java.lang.String _href;
48
49
50       //----------------/
51      //- Constructors -/
52     //----------------/
53
54     public Uri() 
55      {
56         super();
57         setContent("");
58     } //-- org.vamsas.objects.core.Uri()
59
60
61       //-----------/
62      //- Methods -/
63     //-----------/
64
65     /**
66      * Note: hashCode() has not been overriden
67      * 
68      * @param obj
69      * @return boolean
70      */
71     public boolean equals(java.lang.Object obj)
72     {
73         if ( this == obj )
74             return true;
75         
76         if (super.equals(obj)==false)
77             return false;
78         
79         if (obj instanceof Uri) {
80         
81             Uri temp = (Uri)obj;
82             if (this._content != null) {
83                 if (temp._content == null) return false;
84                 else if (!(this._content.equals(temp._content))) 
85                     return false;
86             }
87             else if (temp._content != null)
88                 return false;
89             if (this._href != null) {
90                 if (temp._href == null) return false;
91                 else if (!(this._href.equals(temp._href))) 
92                     return false;
93             }
94             else if (temp._href != null)
95                 return false;
96             return true;
97         }
98         return false;
99     } //-- boolean equals(java.lang.Object) 
100
101     /**
102      * Returns the value of field 'content'. The field 'content'
103      * has the following description: internal content storage
104      * 
105      * @return String
106      * @return the value of field 'content'.
107      */
108     public java.lang.String getContent()
109     {
110         return this._content;
111     } //-- java.lang.String getContent() 
112
113     /**
114      * Returns the value of field 'href'. The field 'href' has the
115      * following description: The URI
116      * 
117      * @return String
118      * @return the value of field 'href'.
119      */
120     public java.lang.String getHref()
121     {
122         return this._href;
123     } //-- java.lang.String getHref() 
124
125     /**
126      * Method isValid
127      * 
128      * 
129      * 
130      * @return boolean
131      */
132     public boolean isValid()
133     {
134         try {
135             validate();
136         }
137         catch (org.exolab.castor.xml.ValidationException vex) {
138             return false;
139         }
140         return true;
141     } //-- boolean isValid() 
142
143     /**
144      * Method marshal
145      * 
146      * 
147      * 
148      * @param out
149      */
150     public void marshal(java.io.Writer out)
151         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
152     {
153         
154         Marshaller.marshal(this, out);
155     } //-- void marshal(java.io.Writer) 
156
157     /**
158      * Method marshal
159      * 
160      * 
161      * 
162      * @param handler
163      */
164     public void marshal(org.xml.sax.ContentHandler handler)
165         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
166     {
167         
168         Marshaller.marshal(this, handler);
169     } //-- void marshal(org.xml.sax.ContentHandler) 
170
171     /**
172      * Sets the value of field 'content'. The field 'content' has
173      * the following description: internal content storage
174      * 
175      * @param content the value of field 'content'.
176      */
177     public void setContent(java.lang.String content)
178     {
179         this._content = content;
180     } //-- void setContent(java.lang.String) 
181
182     /**
183      * Sets the value of field 'href'. The field 'href' has the
184      * following description: The URI
185      * 
186      * @param href the value of field 'href'.
187      */
188     public void setHref(java.lang.String href)
189     {
190         this._href = href;
191     } //-- void setHref(java.lang.String) 
192
193     /**
194      * Method unmarshal
195      * 
196      * 
197      * 
198      * @param reader
199      * @return Uri
200      */
201     public static org.vamsas.objects.core.Uri unmarshal(java.io.Reader reader)
202         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
203     {
204         return (org.vamsas.objects.core.Uri) Unmarshaller.unmarshal(org.vamsas.objects.core.Uri.class, reader);
205     } //-- org.vamsas.objects.core.Uri unmarshal(java.io.Reader) 
206
207     /**
208      * Method validate
209      * 
210      */
211     public void validate()
212         throws org.exolab.castor.xml.ValidationException
213     {
214         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
215         validator.validate(this);
216     } //-- void validate() 
217
218 }