aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Pontesegger2012-10-25 10:19:29 (EDT)
committerBrian de Alwis2012-10-25 10:20:39 (EDT)
commitf67a21e05ad34b4c494893e4c98618baabe62468 (patch)
treefe35f9e2246b222b9950de7e29d07f6eb69a4fb1
parentbdc5129ba5bac8adfc9bb422d22ee7b93dcb9fda (diff)
downloadeclipse.platform.ui-f67a21e05ad34b4c494893e4c98618baabe62468.zip
eclipse.platform.ui-f67a21e05ad34b4c494893e4c98618baabe62468.tar.gz
eclipse.platform.ui-f67a21e05ad34b4c494893e4c98618baabe62468.tar.bz2
Bug 392066 - add toString method to XMLMemento
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
index 7a13851..c3e6892 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/XMLMemento.java
@@ -13,6 +13,7 @@ package org.eclipse.ui;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;
+import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
@@ -607,6 +608,22 @@ public final class XMLMemento implements IMemento {
}
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ try {
+ StringWriter writer = new StringWriter();
+ save(writer);
+ return writer.toString();
+ } catch (IOException e) {
+ return super.toString();
+ }
+ }
+
/**
* A simple XML writer. Using this instead of the javax.xml.transform classes allows
* compilation against JCL Foundation (bug 80053).