Added xstream handiling for Wikipedia upload/download
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.wiki / src / net / sourceforge / phpeclipse / wiki / xml / Revision.java
1 package net.sourceforge.phpeclipse.wiki.xml;
2
3 //
4
5 public class Revision {
6   /**
7    * timeStamp represented in XML format from Wikipedia Special:Export pages
8    */
9   /* package private */String timestamp = null;
10
11   /* package private */String contributor = null;
12
13   /* package private */String text = null;
14
15   /* package private */Revision() {
16   }
17
18   public Revision(String timeStamp, String text, String contributor) {
19     this.timestamp = timeStamp;
20     this.contributor = contributor;
21     this.text = text;
22   }
23
24   public Revision(String timeStamp, String text) {
25     this(timeStamp, text, "");
26   }
27
28   public Revision(String text) {
29     this("", text, "");
30   }
31
32   /*
33    * (non-Javadoc)
34    * 
35    * @see java.lang.Object#toString()
36    */
37   public String toString() {
38     StringBuffer buffer = new StringBuffer();
39
40     if (timestamp != null) {
41       buffer.append("  ==>Timestamp: ");
42       buffer.append(timestamp);
43       buffer.append("\n");
44     }
45
46     if (contributor != null) {
47       buffer.append("  ==>Contributor: ");
48       buffer.append(contributor);
49       buffer.append("\n");
50     }
51
52     if (text != null) {
53       buffer.append("  ==>Body: ");
54       buffer.append(text);
55       buffer.append("\n");
56     }
57     return buffer.toString();
58   }
59
60   /**
61    * @return Returns the timestamp.
62    */
63   public String getTimestamp() {
64     return timestamp;
65   }
66
67   /**
68    * @return Returns the contributor.
69    */
70   public String getContributor() {
71     return contributor;
72   }
73
74   /**
75    * @return Returns the text.
76    */
77   public String getText() {
78     return text;
79   }
80 }