1 7 8 package org.apache.jetspeed.xml.api.jcm; 9 10 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 28 public class Channel implements java.io.Serializable { 29 30 31 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 70 public Channel() { 71 super(); 72 _itemList = new Vector (); 73 } 75 76 80 84 public void addItem(Item vItem) 85 throws java.lang.IndexOutOfBoundsException 86 { 87 _itemList.addElement(vItem); 88 } 90 92 public java.util.Enumeration enumerateItem() 93 { 94 return _itemList.elements(); 95 } 97 99 public java.lang.String getCopyright() 100 { 101 return this._copyright; 102 } 104 106 public java.lang.String getDescription() 107 { 108 return this._description; 109 } 111 113 public java.lang.String getDocs() 114 { 115 return this._docs; 116 } 118 120 public Image getImage() 121 { 122 return this._image; 123 } 125 129 public Item getItem(int index) 130 throws java.lang.IndexOutOfBoundsException 131 { 132 if ((index < 0) || (index > _itemList.size())) { 134 throw new IndexOutOfBoundsException (); 135 } 136 137 return (Item) _itemList.elementAt(index); 138 } 140 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 } 152 154 public int getItemCount() 155 { 156 return _itemList.size(); 157 } 159 161 public java.lang.String getLanguage() 162 { 163 return this._language; 164 } 166 168 public java.lang.String getLastBuildDate() 169 { 170 return this._lastBuildDate; 171 } 173 175 public java.lang.String getLink() 176 { 177 return this._link; 178 } 180 182 public java.lang.String getManagingEditor() 183 { 184 return this._managingEditor; 185 } 187 189 public java.lang.String getPubDate() 190 { 191 return this._pubDate; 192 } 194 196 public java.lang.String getRating() 197 { 198 return this._rating; 199 } 201 203 public Textinput getTextinput() 204 { 205 return this._textinput; 206 } 208 210 public java.lang.String getTitle() 211 { 212 return this._title; 213 } 215 217 public Topics getTopics() 218 { 219 return this._topics; 220 } 222 224 public java.lang.String getWebMaster() 225 { 226 return this._webMaster; 227 } 229 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 } 242 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 } 253 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 } 264 266 public void removeAllItem() 267 { 268 _itemList.removeAllElements(); 269 } 271 275 public Item removeItem(int index) 276 { 277 Object obj = _itemList.elementAt(index); 278 _itemList.removeElementAt(index); 279 return (Item) obj; 280 } 282 286 public void setCopyright(java.lang.String copyright) 287 { 288 this._copyright = copyright; 289 } 291 295 public void setDescription(java.lang.String description) 296 { 297 this._description = description; 298 } 300 304 public void setDocs(java.lang.String docs) 305 { 306 this._docs = docs; 307 } 309 313 public void setImage(Image image) 314 { 315 this._image = image; 316 } 318 323 public void setItem(int index, Item vItem) 324 throws java.lang.IndexOutOfBoundsException 325 { 326 if ((index < 0) || (index > _itemList.size())) { 328 throw new IndexOutOfBoundsException (); 329 } 330 _itemList.setElementAt(vItem, index); 331 } 333 337 public void setItem(Item[] itemArray) 338 { 339 _itemList.removeAllElements(); 341 for (int i = 0; i < itemArray.length; i++) { 342 _itemList.addElement(itemArray[i]); 343 } 344 } 346 350 public void setLanguage(java.lang.String language) 351 { 352 this._language = language; 353 } 355 359 public void setLastBuildDate(java.lang.String lastBuildDate) 360 { 361 this._lastBuildDate = lastBuildDate; 362 } 364 368 public void setLink(java.lang.String link) 369 { 370 this._link = link; 371 } 373 377 public void setManagingEditor(java.lang.String managingEditor) 378 { 379 this._managingEditor = managingEditor; 380 } 382 386 public void setPubDate(java.lang.String pubDate) 387 { 388 this._pubDate = pubDate; 389 } 391 395 public void setRating(java.lang.String rating) 396 { 397 this._rating = rating; 398 } 400 404 public void setTextinput(Textinput textinput) 405 { 406 this._textinput = textinput; 407 } 409 413 public void setTitle(java.lang.String title) 414 { 415 this._title = title; 416 } 418 422 public void setTopics(Topics topics) 423 { 424 this._topics = topics; 425 } 427 431 public void setWebMaster(java.lang.String webMaster) 432 { 433 this._webMaster = webMaster; 434 } 436 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 } 446 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 } 455 } 456 | Popular Tags |