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>image</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 Image implements Serializable {
32
33
34
35
36
37 /***
38 * The image description (1-100 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 image height in pixels (1-400).
53 */
54 protected int height = 31;
55
56 public int getHeight() {
57 return (this.height);
58 }
59
60 public void setHeight(int height) {
61 this.height = height;
62 }
63
64
65 /***
66 * The image link (1-500 characters).
67 */
68 protected String link = null;
69
70 public String getLink() {
71 return (this.link);
72 }
73
74 public void setLink(String link) {
75 this.link = link;
76 }
77
78
79 /***
80 * The image alternate text (1-100 characters).
81 */
82 protected String title = null;
83
84 public String getTitle() {
85 return (this.title);
86 }
87
88 public void setTitle(String title) {
89 this.title = title;
90 }
91
92
93 /***
94 * The image location URL (1-500 characters).
95 */
96 protected String url = null;
97
98 public String getURL() {
99 return (this.url);
100 }
101
102 public void setURL(String url) {
103 this.url = url;
104 }
105
106
107 /***
108 * The image width in pixels (1-400).
109 */
110 protected int width = 31;
111
112 public int getWidth() {
113 return (this.width);
114 }
115
116 public void setWidth(int width) {
117 this.width = width;
118 }
119
120
121
122
123
124 /***
125 * Render this channel as XML conforming to the RSS 0.91 specification,
126 * to the specified writer.
127 *
128 * @param writer The writer to render output to
129 */
130 void render(PrintWriter writer) {
131
132 writer.println(" <image>");
133
134 writer.print(" <title>");
135 writer.print(title);
136 writer.println("</title>");
137
138 writer.print(" <url>");
139 writer.print(url);
140 writer.println("</url>");
141
142 if (link != null) {
143 writer.print(" <link>");
144 writer.print(link);
145 writer.println("</link>");
146 }
147
148 writer.print(" <width>");
149 writer.print(width);
150 writer.println("</width>");
151
152 writer.print(" <height>");
153 writer.print(height);
154 writer.println("</height>");
155
156 if (description != null) {
157 writer.print(" <description>");
158 writer.print(description);
159 writer.println("</description>");
160 }
161
162 writer.println(" </image>");
163
164 }
165
166
167 }