1 19 20 package org.jperdian.rss2.dom; 21 22 import java.io.Serializable ; 23 import java.net.URL ; 24 import java.util.ArrayList ; 25 import java.util.Date ; 26 import java.util.List ; 27 28 34 35 public class RssItem implements Serializable { 36 37 private String myTitle = ""; 38 private URL myLink = null; 39 private String myDescription = ""; 40 private String myStrippedDescription = ""; 41 private String myAuthor = ""; 42 private List myCategoryList = new ArrayList (); 43 private String myComments = null; 44 private RssEnclosure myEnclosure = null; 45 private RssGuid myGuid = null; 46 private Date myPubDate = null; 47 private RssChannel mySource = null; 48 49 50 54 public String getAuthor() { 55 return this.myAuthor; 56 } 57 58 public void setAuthor(String author) { 59 this.myAuthor = author; 60 } 61 62 public void addCategory(String category) { 63 this.getCategoryList().add(category); 64 } 65 66 public List getCategoryList() { 67 return this.myCategoryList; 68 } 69 70 public void setCategoryList(List list) { 71 this.myCategoryList = list; 72 } 73 74 public String getComments() { 75 return this.myComments; 76 } 77 78 public void setComments(String comments) { 79 this.myComments = comments; 80 } 81 82 public String getDescription() { 83 return this.myDescription; 84 } 85 86 public String getStrippedDescription() { 87 return this.myStrippedDescription; 88 } 89 90 public void setDescription(String description) { 91 this.myDescription = description; 92 this.myStrippedDescription = description.trim(); 93 94 int start = myStrippedDescription.indexOf('<'); 95 while(start >= 0) 96 { 97 int end = myStrippedDescription.indexOf('>', start); 98 if(end < 0) 99 break; 100 101 myStrippedDescription = myStrippedDescription.substring(0, start) 102 + myStrippedDescription.substring(end+1); 103 start = myStrippedDescription.indexOf('<'); 104 } 105 } 106 107 public RssEnclosure getEnclosure() { 108 return this.myEnclosure; 109 } 110 111 public void setEnclosure(RssEnclosure enclosure) { 112 this.myEnclosure = enclosure; 113 } 114 115 public RssGuid getGuid() { 116 return this.myGuid; 117 } 118 119 public void setGuid(RssGuid guid) { 120 this.myGuid = guid; 121 } 122 123 public URL getLink() { 124 return myLink; 125 } 126 127 public void setLink(URL link) { 128 this.myLink = link; 129 } 130 131 public Date getPubDate() { 132 return this.myPubDate; 133 } 134 135 public void setPubDate(Date pubDate) { 136 this.myPubDate = pubDate; 137 } 138 139 public RssChannel getSource() { 140 return this.mySource; 141 } 142 143 public void setSource(RssChannel source) { 144 this.mySource = source; 145 } 146 147 public String getTitle() { 148 return this.myTitle; 149 } 150 151 public void setTitle(String title) { 152 this.myTitle = title; 153 } 154 } | Popular Tags |