Details
-
Type: Improvement
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2
-
Component/s: None
-
Labels:None
-
JDK version and platform:All
Description
Having a base Exception class for all XStream exception will make easier to manipulate exceptions.
I'm migrating a proprietary XML code to use Xstream, but in order to keep backwards XML compatibility I'll need to keep the old version of the XML utility classes.
My idea is to use something like:
ObjectX x = null;
try {
x = (ObjectX) XMLStream.fromXML(xmlString);
} catch (BaseException) { //conversion of XML failed. Try with the old XML tool
x - (ObjectX) OldXmlTool.fromXML(xmlString);
}
return x;
Done. All RuntimeException in XStream should be derived from BaseException, it was a plain oversight.