1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.sun.syndication.io.impl;
18
19 import com.sun.syndication.io.WireFeedGenerator;
20
21 import java.util.List;
22
23 /***
24 * Generates an XML document (JDOM Document) out of a Feed.
25 * <p>
26 * It can generate all flavors of RSS (0.90, 0.91, 0.92, 0.93, 0.94, 1.0 and 2.0) and
27 * Atom 0.3 feed.
28 * <p>
29 * WireFeedGenerator instances are thread safe.
30 * <p>
31 * Generators for a specific type must extend this class and register in the generator list.
32 * (Right now registration is hardcoded in the WireFeedGenerator constructor).
33 * <p>
34 * @author Alejandro Abdelnur
35 *
36 */
37 public class FeedGenerators extends PluginManager {
38
39 /***
40 * WireFeedGenerator.classes= [className] ...
41 *
42 */
43 public static final String FEED_GENERATORS_KEY = "WireFeedGenerator.classes";
44
45
46 public FeedGenerators() {
47 super(FEED_GENERATORS_KEY);
48 }
49
50 public WireFeedGenerator getGenerator(String feedType) {
51 return (WireFeedGenerator) getPlugin(feedType);
52 }
53
54 protected String getKey(Object obj) {
55 return ((WireFeedGenerator)obj).getType();
56 }
57
58 public List getSupportedFeedTypes() {
59 return getKeys();
60 }
61
62 }