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.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: public FeedGenerators() {
46: super (FEED_GENERATORS_KEY);
47: }
48:
49: public WireFeedGenerator getGenerator(String feedType) {
50: return (WireFeedGenerator) getPlugin(feedType);
51: }
52:
53: protected String getKey(Object obj) {
54: return ((WireFeedGenerator) obj).getType();
55: }
56:
57: public List getSupportedFeedTypes() {
58: return getKeys();
59: }
60:
61: }
|