Added xstream handiling for Wikipedia upload/download
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.wiki / src / net / sourceforge / phpeclipse / wiki / xml / Revision.java
diff --git a/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/xml/Revision.java b/archive/net.sourceforge.phpeclipse.wiki/src/net/sourceforge/phpeclipse/wiki/xml/Revision.java
new file mode 100644 (file)
index 0000000..75e73df
--- /dev/null
@@ -0,0 +1,80 @@
+package net.sourceforge.phpeclipse.wiki.xml;
+
+//
+
+public class Revision {
+  /**
+   * timeStamp represented in XML format from Wikipedia Special:Export pages
+   */
+  /* package private */String timestamp = null;
+
+  /* package private */String contributor = null;
+
+  /* package private */String text = null;
+
+  /* package private */Revision() {
+  }
+
+  public Revision(String timeStamp, String text, String contributor) {
+    this.timestamp = timeStamp;
+    this.contributor = contributor;
+    this.text = text;
+  }
+
+  public Revision(String timeStamp, String text) {
+    this(timeStamp, text, "");
+  }
+
+  public Revision(String text) {
+    this("", text, "");
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see java.lang.Object#toString()
+   */
+  public String toString() {
+    StringBuffer buffer = new StringBuffer();
+
+    if (timestamp != null) {
+      buffer.append("  ==>Timestamp: ");
+      buffer.append(timestamp);
+      buffer.append("\n");
+    }
+
+    if (contributor != null) {
+      buffer.append("  ==>Contributor: ");
+      buffer.append(contributor);
+      buffer.append("\n");
+    }
+
+    if (text != null) {
+      buffer.append("  ==>Body: ");
+      buffer.append(text);
+      buffer.append("\n");
+    }
+    return buffer.toString();
+  }
+
+  /**
+   * @return Returns the timestamp.
+   */
+  public String getTimestamp() {
+    return timestamp;
+  }
+
+  /**
+   * @return Returns the contributor.
+   */
+  public String getContributor() {
+    return contributor;
+  }
+
+  /**
+   * @return Returns the text.
+   */
+  public String getText() {
+    return text;
+  }
+}
\ No newline at end of file