1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.feedparser;
18
19 import org.jdom.*;
20
21 /***
22 *
23 * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a>
24 * @version $Id: FeedVersion.java 159215 2005-03-27 23:36:16Z burton $
25 */
26 public class FeedVersion {
27
28 /***
29 * True if this is an Atom feed.
30 */
31 public boolean isAtom;
32
33 /***
34 * True if this is an RSS feed
35 */
36 public boolean isRSS;
37
38 /***
39 * True when this is a Friend of a Friend FOAF file.
40 */
41 public boolean isFOAF;
42
43 public boolean isOPML;
44
45 public boolean isXFN;
46
47 /***
48 * True if this is a changes.xml file.
49 */
50 public boolean isChanges;
51
52 /***
53 * The version of this specification. If this is RSS 1.0 the version will
54 * be "1.0". If this is Atom 0.5 the version will be "0.5" (and so
55 * forth). If the version is unknown the value is simply null. The format
56 * of this is unstructured text and in many situations is mirrored right
57 * form the 'version' attribute in some RSS/Atom specifications. See
58 * version_major, version_minor, and version_sub for more info.
59 *
60 *
61 */
62 public String version = null;
63
64 public int version_major = 0;
65 public int version_minor = 0;
66 public int version_sub = 0;
67
68 public String toString() {
69
70 String result = "";
71
72 if ( isAtom )
73 result = "atom";
74 else if ( isRSS )
75 result = "rss";
76 else if ( isFOAF )
77 result = "foaf";
78 else if ( isOPML )
79 result = "opml";
80 else if ( isXFN )
81 result = "xfn";
82 else if ( isChanges )
83 result = "changes";
84
85 return result += ":" + version;
86
87 }
88
89 }