1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.votable;
9
10
11
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 INFO.
26 *
27 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:14 $
28 */
29 public class INFO extends org.astrogrid.registry.beans.resource.votable.AnyTEXT
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * Field _ID
40 */
41 private java.lang.String _ID;
42
43 /***
44 * Field _name
45 */
46 private java.lang.String _name;
47
48 /***
49 * Field _value
50 */
51 private java.lang.String _value;
52
53 /***
54 * internal content storage
55 */
56 private java.lang.String _content = "";
57
58
59
60
61
62
63 public INFO() {
64 super();
65 setContent("");
66 }
67
68
69
70
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 INFO) {
87
88 INFO temp = (INFO)obj;
89 if (this._ID != null) {
90 if (temp._ID == null) return false;
91 else if (!(this._ID.equals(temp._ID)))
92 return false;
93 }
94 else if (temp._ID != null)
95 return false;
96 if (this._name != null) {
97 if (temp._name == null) return false;
98 else if (!(this._name.equals(temp._name)))
99 return false;
100 }
101 else if (temp._name != null)
102 return false;
103 if (this._value != null) {
104 if (temp._value == null) return false;
105 else if (!(this._value.equals(temp._value)))
106 return false;
107 }
108 else if (temp._value != null)
109 return false;
110 if (this._content != null) {
111 if (temp._content == null) return false;
112 else if (!(this._content.equals(temp._content)))
113 return false;
114 }
115 else if (temp._content != null)
116 return false;
117 return true;
118 }
119 return false;
120 }
121
122 /***
123 * Returns the value of field 'content'. The field 'content'
124 * has the following description: internal content storage
125 *
126 * @return the value of field 'content'.
127 */
128 public java.lang.String getContent()
129 {
130 return this._content;
131 }
132
133 /***
134 * Returns the value of field 'ID'.
135 *
136 * @return the value of field 'ID'.
137 */
138 public java.lang.String getID()
139 {
140 return this._ID;
141 }
142
143 /***
144 * Returns the value of field 'name'.
145 *
146 * @return the value of field 'name'.
147 */
148 public java.lang.String getName()
149 {
150 return this._name;
151 }
152
153 /***
154 * Returns the value of field 'value'.
155 *
156 * @return the value of field 'value'.
157 */
158 public java.lang.String getValue()
159 {
160 return this._value;
161 }
162
163 /***
164 * Method isValid
165 */
166 public boolean isValid()
167 {
168 try {
169 validate();
170 }
171 catch (org.exolab.castor.xml.ValidationException vex) {
172 return false;
173 }
174 return true;
175 }
176
177 /***
178 * Method marshal
179 *
180 * @param out
181 */
182 public void marshal(java.io.Writer out)
183 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
184 {
185
186 Marshaller.marshal(this, out);
187 }
188
189 /***
190 * Method marshal
191 *
192 * @param handler
193 */
194 public void marshal(org.xml.sax.ContentHandler handler)
195 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
196 {
197
198 Marshaller.marshal(this, handler);
199 }
200
201 /***
202 * Sets the value of field 'content'. The field 'content' has
203 * the following description: internal content storage
204 *
205 * @param content the value of field 'content'.
206 */
207 public void setContent(java.lang.String content)
208 {
209 this._content = content;
210 }
211
212 /***
213 * Sets the value of field 'ID'.
214 *
215 * @param ID the value of field 'ID'.
216 */
217 public void setID(java.lang.String ID)
218 {
219 this._ID = ID;
220 }
221
222 /***
223 * Sets the value of field 'name'.
224 *
225 * @param name the value of field 'name'.
226 */
227 public void setName(java.lang.String name)
228 {
229 this._name = name;
230 }
231
232 /***
233 * Sets the value of field 'value'.
234 *
235 * @param value the value of field 'value'.
236 */
237 public void setValue(java.lang.String value)
238 {
239 this._value = value;
240 }
241
242 /***
243 * Method unmarshalINFO
244 *
245 * @param reader
246 */
247 public static org.astrogrid.registry.beans.resource.votable.INFO unmarshalINFO(java.io.Reader reader)
248 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
249 {
250 return (org.astrogrid.registry.beans.resource.votable.INFO) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.votable.INFO.class, reader);
251 }
252
253 /***
254 * Method validate
255 */
256 public void validate()
257 throws org.exolab.castor.xml.ValidationException
258 {
259 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
260 validator.validate(this);
261 }
262
263 }