1
2
3
4
5
6
7
8 package org.apache.jetspeed.xml.api.jcm;
9
10
11
12
13
14 import java.io.Reader;
15 import java.io.Serializable;
16 import java.io.Writer;
17 import java.util.Enumeration;
18 import java.util.Vector;
19 import org.exolab.castor.xml.*;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.DocumentHandler;
23
24 /***
25 *
26 * @version $Revision$ $Date$
27 **/
28 public class Channel implements java.io.Serializable {
29
30
31
32
33
34
35 private Topics _topics;
36
37 private java.util.Vector _itemList;
38
39 private java.lang.String _title;
40
41 private java.lang.String _link;
42
43 private java.lang.String _description;
44
45 private Image _image;
46
47 private Textinput _textinput;
48
49 private java.lang.String _rating;
50
51 private java.lang.String _copyright;
52
53 private java.lang.String _pubDate;
54
55 private java.lang.String _lastBuildDate;
56
57 private java.lang.String _docs;
58
59 private java.lang.String _managingEditor;
60
61 private java.lang.String _webMaster;
62
63 private java.lang.String _language;
64
65
66
67
68
69
70 public Channel() {
71 super();
72 _itemList = new Vector();
73 }
74
75
76
77
78
79
80 /***
81 *
82 * @param vItem
83 **/
84 public void addItem(Item vItem)
85 throws java.lang.IndexOutOfBoundsException
86 {
87 _itemList.addElement(vItem);
88 }
89
90 /***
91 **/
92 public java.util.Enumeration enumerateItem()
93 {
94 return _itemList.elements();
95 }
96
97 /***
98 **/
99 public java.lang.String getCopyright()
100 {
101 return this._copyright;
102 }
103
104 /***
105 **/
106 public java.lang.String getDescription()
107 {
108 return this._description;
109 }
110
111 /***
112 **/
113 public java.lang.String getDocs()
114 {
115 return this._docs;
116 }
117
118 /***
119 **/
120 public Image getImage()
121 {
122 return this._image;
123 }
124
125 /***
126 *
127 * @param index
128 **/
129 public Item getItem(int index)
130 throws java.lang.IndexOutOfBoundsException
131 {
132
133 if ((index < 0) || (index > _itemList.size())) {
134 throw new IndexOutOfBoundsException();
135 }
136
137 return (Item) _itemList.elementAt(index);
138 }
139
140 /***
141 **/
142 public Item[] getItem()
143 {
144 int size = _itemList.size();
145 Item[] mArray = new Item[size];
146 for (int index = 0; index < size; index++) {
147 mArray[index] = (Item) _itemList.elementAt(index);
148 }
149 return mArray;
150 }
151
152 /***
153 **/
154 public int getItemCount()
155 {
156 return _itemList.size();
157 }
158
159 /***
160 **/
161 public java.lang.String getLanguage()
162 {
163 return this._language;
164 }
165
166 /***
167 **/
168 public java.lang.String getLastBuildDate()
169 {
170 return this._lastBuildDate;
171 }
172
173 /***
174 **/
175 public java.lang.String getLink()
176 {
177 return this._link;
178 }
179
180 /***
181 **/
182 public java.lang.String getManagingEditor()
183 {
184 return this._managingEditor;
185 }
186
187 /***
188 **/
189 public java.lang.String getPubDate()
190 {
191 return this._pubDate;
192 }
193
194 /***
195 **/
196 public java.lang.String getRating()
197 {
198 return this._rating;
199 }
200
201 /***
202 **/
203 public Textinput getTextinput()
204 {
205 return this._textinput;
206 }
207
208 /***
209 **/
210 public java.lang.String getTitle()
211 {
212 return this._title;
213 }
214
215 /***
216 **/
217 public Topics getTopics()
218 {
219 return this._topics;
220 }
221
222 /***
223 **/
224 public java.lang.String getWebMaster()
225 {
226 return this._webMaster;
227 }
228
229 /***
230 **/
231 public boolean isValid()
232 {
233 try {
234 validate();
235 }
236 catch (org.exolab.castor.xml.ValidationException vex) {
237 return false;
238 }
239 return true;
240 }
241
242 /***
243 *
244 * @param out
245 **/
246 public void marshal(java.io.Writer out)
247 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
248 {
249
250 Marshaller.marshal(this, out);
251 }
252
253 /***
254 *
255 * @param handler
256 **/
257 public void marshal(org.xml.sax.DocumentHandler handler)
258 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
259 {
260
261 Marshaller.marshal(this, handler);
262 }
263
264 /***
265 **/
266 public void removeAllItem()
267 {
268 _itemList.removeAllElements();
269 }
270
271 /***
272 *
273 * @param index
274 **/
275 public Item removeItem(int index)
276 {
277 Object obj = _itemList.elementAt(index);
278 _itemList.removeElementAt(index);
279 return (Item) obj;
280 }
281
282 /***
283 *
284 * @param copyright
285 **/
286 public void setCopyright(java.lang.String copyright)
287 {
288 this._copyright = copyright;
289 }
290
291 /***
292 *
293 * @param description
294 **/
295 public void setDescription(java.lang.String description)
296 {
297 this._description = description;
298 }
299
300 /***
301 *
302 * @param docs
303 **/
304 public void setDocs(java.lang.String docs)
305 {
306 this._docs = docs;
307 }
308
309 /***
310 *
311 * @param image
312 **/
313 public void setImage(Image image)
314 {
315 this._image = image;
316 }
317
318 /***
319 *
320 * @param index
321 * @param vItem
322 **/
323 public void setItem(int index, Item vItem)
324 throws java.lang.IndexOutOfBoundsException
325 {
326
327 if ((index < 0) || (index > _itemList.size())) {
328 throw new IndexOutOfBoundsException();
329 }
330 _itemList.setElementAt(vItem, index);
331 }
332
333 /***
334 *
335 * @param itemArray
336 **/
337 public void setItem(Item[] itemArray)
338 {
339
340 _itemList.removeAllElements();
341 for (int i = 0; i < itemArray.length; i++) {
342 _itemList.addElement(itemArray[i]);
343 }
344 }
345
346 /***
347 *
348 * @param language
349 **/
350 public void setLanguage(java.lang.String language)
351 {
352 this._language = language;
353 }
354
355 /***
356 *
357 * @param lastBuildDate
358 **/
359 public void setLastBuildDate(java.lang.String lastBuildDate)
360 {
361 this._lastBuildDate = lastBuildDate;
362 }
363
364 /***
365 *
366 * @param link
367 **/
368 public void setLink(java.lang.String link)
369 {
370 this._link = link;
371 }
372
373 /***
374 *
375 * @param managingEditor
376 **/
377 public void setManagingEditor(java.lang.String managingEditor)
378 {
379 this._managingEditor = managingEditor;
380 }
381
382 /***
383 *
384 * @param pubDate
385 **/
386 public void setPubDate(java.lang.String pubDate)
387 {
388 this._pubDate = pubDate;
389 }
390
391 /***
392 *
393 * @param rating
394 **/
395 public void setRating(java.lang.String rating)
396 {
397 this._rating = rating;
398 }
399
400 /***
401 *
402 * @param textinput
403 **/
404 public void setTextinput(Textinput textinput)
405 {
406 this._textinput = textinput;
407 }
408
409 /***
410 *
411 * @param title
412 **/
413 public void setTitle(java.lang.String title)
414 {
415 this._title = title;
416 }
417
418 /***
419 *
420 * @param topics
421 **/
422 public void setTopics(Topics topics)
423 {
424 this._topics = topics;
425 }
426
427 /***
428 *
429 * @param webMaster
430 **/
431 public void setWebMaster(java.lang.String webMaster)
432 {
433 this._webMaster = webMaster;
434 }
435
436 /***
437 *
438 * @param reader
439 **/
440 public static org.apache.jetspeed.xml.api.jcm.Channel unmarshal(java.io.Reader reader)
441 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
442 {
443 return (org.apache.jetspeed.xml.api.jcm.Channel) Unmarshaller.unmarshal(org.apache.jetspeed.xml.api.jcm.Channel.class, reader);
444 }
445
446 /***
447 **/
448 public void validate()
449 throws org.exolab.castor.xml.ValidationException
450 {
451 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
452 validator.validate(this);
453 }
454
455 }