1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.sun.syndication.io;
18
19 import com.sun.syndication.feed.AbstractFeed;
20 import com.sun.syndication.io.FeedException;
21 import org.jdom.Document;
22
23 /***
24 * Generates an XML document (JDOM) out of a feed for a specific real feed type.
25 * <p>
26 * FeedGenerator instances must thread safe.
27 * <p>
28 * TODO: explain how developers can plugin their own implementations.
29 * <p>
30 * @author Alejandro Abdelnur
31 *
32 */
33 public interface FeedGenerator {
34
35 /***
36 * Returns the type of feed the generator creates.
37 * <p>
38 * @see AbstractFeed for details on the format of this string.
39 * <p>
40 * @return the type of feed the generator creates.
41 *
42 */
43 public String getType();
44
45 /***
46 * Creates an XML document (JDOM) for the given feed bean.
47 * <p>
48 * @param feed the feed bean to generate the XML document from.
49 * @return the generated XML document (JDOM).
50 * @throws IllegalArgumentException thrown if the type of the given feed bean does not
51 * match with the type of the FeedGenerator.
52 * @throws FeedException thrown if the XML Document could not be created.
53 *
54 */
55 public Document generate(AbstractFeed feed) throws IllegalArgumentException,FeedException;
56
57 }