01: /*
02: * Copyright 2004 Sun Microsystems, Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: *
16: */
17: package com.sun.syndication.io.impl;
18:
19: import com.sun.syndication.feed.rss.Item;
20: import org.jdom.Element;
21:
22: import java.util.Date;
23: import java.util.List;
24:
25: /**
26: * Feed Generator for RSS 0.93
27: * <p/>
28: *
29: * @author Elaine Chien
30: *
31: */
32: public class RSS093Generator extends RSS092Generator {
33:
34: public RSS093Generator() {
35: this ("rss_0.93", "0.93");
36: }
37:
38: protected RSS093Generator(String feedType, String version) {
39: super (feedType, version);
40: }
41:
42: protected void populateItem(Item item, Element eItem, int index) {
43: super .populateItem(item, eItem, index);
44:
45: Date pubDate = item.getPubDate();
46: if (pubDate != null) {
47: eItem.addContent(generateSimpleElement("pubDate",
48: DateParser.formatRFC822(pubDate)));
49: }
50:
51: Date expirationDate = item.getExpirationDate();
52: if (expirationDate != null) {
53: eItem.addContent(generateSimpleElement("expirationDate",
54: DateParser.formatRFC822(expirationDate)));
55: }
56: }
57:
58: // Another one to thanks DW for
59: protected int getNumberOfEnclosures(List enclosures) {
60: return enclosures.size();
61: }
62:
63: }
|