1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.digester.rss;
20
21 import java.io.PrintWriter;
22 import java.io.Serializable;
23
24
25 /***
26 * <p>Implementation object representing an <strong>item</strong> in the
27 * <em>Rich Site Summary</em> DTD, version 0.91. This class may be subclassed
28 * to further specialize its behavior.</p>
29 */
30
31 public class Item implements Serializable {
32
33
34
35
36
37 /***
38 * The item description (1-500 characters).
39 */
40 protected String description = null;
41
42 public String getDescription() {
43 return (this.description);
44 }
45
46 public void setDescription(String description) {
47 this.description = description;
48 }
49
50
51 /***
52 * The item link (1-500 characters).
53 */
54 protected String link = null;
55
56 public String getLink() {
57 return (this.link);
58 }
59
60 public void setLink(String link) {
61 this.link = link;
62 }
63
64
65 /***
66 * The item title (1-100 characters).
67 */
68 protected String title = null;
69
70 public String getTitle() {
71 return (this.title);
72 }
73
74 public void setTitle(String title) {
75 this.title = title;
76 }
77
78
79
80
81
82 /***
83 * Render this channel as XML conforming to the RSS 0.91 specification,
84 * to the specified writer.
85 *
86 * @param writer The writer to render output to
87 */
88 void render(PrintWriter writer) {
89
90 writer.println(" <item>");
91
92 writer.print(" <title>");
93 writer.print(title);
94 writer.println("</title>");
95
96 writer.print(" <link>");
97 writer.print(link);
98 writer.println("</link>");
99
100 if (description != null) {
101 writer.print(" <description>");
102 writer.print(description);
103 writer.println("</description>");
104 }
105
106 writer.println(" </item>");
107
108 }
109
110
111 }