1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.sun.syndication.feed.synd;
18
19 import com.sun.syndication.feed.WireFeed;
20 import com.sun.syndication.feed.synd.SyndFeed;
21
22 /***
23 * Interface that defines the functionality to convert a SyndFeedImpl
24 * to a real feed (RSS or Atom) and vice versa.
25 * <p>
26 * Each implementation knows how to deal with a specific type (version)
27 * of a real feed.
28 * <p>
29 * Implementations must be thread safe.
30 * <p>
31 * TODO: explain how developers can plugin their own implementations.
32 * <p>
33 * @author Alejandro Abdelnur
34 *
35 */
36 public interface Converter {
37
38 /***
39 * Returns the type (version) of the real feed this converter handles.
40 * <p>
41 * @see WireFeed for details on the format of this string.
42 * <p>
43 * @return the real feed type.
44 *
45 */
46 public String getType();
47
48 /***
49 * Makes a deep copy/conversion of the values of a real feed into a SyndFeedImpl.
50 * <p>
51 * It assumes the given SyndFeedImpl has no properties set.
52 * <p>
53 * @param feed real feed to copy/convert.
54 * @param syndFeed the SyndFeedImpl that will contain the copied/converted values of the real feed.
55 *
56 */
57 public void copyInto(WireFeed feed,SyndFeed syndFeed);
58
59 /***
60 * Creates real feed with a deep copy/conversion of the values of a SyndFeedImpl.
61 * <p>
62 * @param syndFeed SyndFeedImpl to copy/convert value from.
63 * @return a real feed with copied/converted values of the SyndFeedImpl.
64 *
65 */
66 public WireFeed createRealFeed(SyndFeed syndFeed);
67
68 }