Changes are split into three categories:
- Major changes: The major new features that all users should know about.
- Minor changes: Any smaller changes, including bugfixes.
- API changes: Any changes to the API that could impact existing users.
Full details can be found in Jira's
Roadmap and
Change Log.
Version 1.2.2
Released 24 May 2007.
Note, that next version of XStream will behave slightly different by default. XStream emits
all fields in declaration order like Java serialization. But in contrast to Java it will omit the fields of parent
classes last while Java serialization emits them first. This makes it difficult to match a given XML schema that
defined inherited types or leads sometimes to obscure initialization problems. However, XStream itself will not be
affected by the changed order of elements in the XML, any deserialization of current XML representations will work
fine. Anyway we will provide with XStream 1.3 a FieldKeySorter implementation that mimics the old behaviour. In
the meanwhile you can enforce the new field sorting by installing the NaturalFieldKeySorter.
Major changes
- JIRA:XSTR-391, Support for writing (and reading) JSON by the new JettisonMappedXmlDriver (by Dejan Bosanac).
- New FieldKeySorter interface allows a custom sort order of the XML elements.
- JIRA:XSTR-68 and JIRA:XSTR-210, OmitField is now respected at deserialization to ignore removed fields.
Minor changes
- JIRA:XSTR-387, Fix aliasing of inherited fields.
- JIRS:XSTR-395, Fix StringConverter allocating PermGen space.
- JIRA:XSTR-368, @XStreamConverter converters should be cached inside the AnnotationReflectionConverter.
- JIRA:XSTR-392, @XStreamOmitField can be used to omit fields from the resulting XML (contributed by Chung-Onn Cheong).
- JIRA:XSTR-371, Fix JSONWriter that omits a closing bracket for for fields with null value.
- JIRA:XSTR-398, DomDriver ignores given XmlFriendlyReplacer.
- JIRA:XSTR-370, Buildable with JDK 6, fix FontConverter for JDK 6.
- JIRA:XSTR-382, Support hex and octal number values.
- DateConverter did not respect change in TimeZone after first usage.
- JIRA:XSTR-375, Support for aliasing native types.
- JIRA:XSTR-243 again, XML elements for transient fields are now ignored completely at deserialization.
- Release unused object references to keep memory print low.
- Support for AWT and SQL is now optional: XStream now works on embedded virtual machines lacking such APIs (by Nicolas Gros d'Aillon).
- Support raw bytes read from the ObjectInputStream.
- JIRA:XSTR-373, Support for Hitachi JVM (tested by Yuji Yamano).
- JIRA:XSTR-378 and JIRA:XSTR-379, Fix TextAttributeConverter and EnumSetConverter failing on Apache Harmony.
- JIRA:XSTR-363, Support of native field order i.e. fields are processed in declaration order base classes first.
- JIRA:XSTR-320, Static field in child may hide non-static field in parent.
API changes
- JIRA:XSTR-365, Multiple implicit collections with annotations. Deprecated @XStreamImclicitCollection in favour of @XStreamImplicit
declared at field level.
Version 1.2.1
Released 11 November 2006.
Major changes
- Introduced DocumentWriter interface and generalized functionality for all writer implementations
creating a DOM structure (DOM4J, DOM, JDom, Xom, Xpp3Dom).
- Refactored build system to use Maven 2. Ant still supported on XStream Core.
- Created separate XStream Benchmark module
Minor changes
- JIRA:XSTR-346, XStream.getClassMapper() does not return a ClassMapper for the current Mapper.
- Fix problem with fields containing a double underscore.
- JIRA:XSTR-345, Dom4JWriter adds up attributes.
- JIRA:XSTR-336, XStream fails to reference an implicit element.
- JIRA:XSTR-337, Annotation cycle bug.
- Fix packaging error for the resulting jar building with Maven2.
- JIRA:XSTR-339, NPE for attribute null values.
- JIRA:XSTR-338, NPE in JSON writer for converters using non-extended HierarchicalStreamWriter.
- JIRA:XSTR-357, Fix escaping of values in JSON writer.
- JIRA:XSTR-356, Fix unmarshaling error for fields containing proxies.
- JIRA:XSTR-349, Fix backward compatibility of Dom4jWriter.
- JIRA:XSTR-309, More versatile boolean conversion options (contributed by David Blevins).
- Add XStream.getReflectionProvider() to retrieve ReflectionProvider in use.
- JIRA:XSTR-358, @XStreamConverter annotation does not call converter constructor.
- Website generated using XSite
API changes
- Deprecate JDomWriter.getResult() in favour of DocumentWriter.getTopLevelNodes().
- Deprecate ThreadSafeSimpleDateFormat, since this is an internal helper and not part of XStream API.
Version 1.2
Released 18 August 2006.
Major changes
- JIRA:XSTR-269, Using attributes for fields (contributed by Paul Hammant and Ian Cartwright).
- Aliasing of arbitrary attributes.
- JIRA:XSTR-50, XStream can now serialize another XStream instance.
- JIRA:XSTR-227, XStream has now the XStreamer, that serializes an object together with its XStream instance.
- JIRA:XSTR-278, AnnotationConverter for fields (contributed by Guilherme Silveira).
- JIRA:XSTR-256, PureJavaReflectionProvider supports now final fields starting with JDK 1.5
- JIRA:XSTR-258, Any Collection type can now be declared implicit, the default implementation will be respected for unmarshaling.
- JIRA:XSTR-88, XStream can now write all references as absolute XPath expression.
- JIRA:XSTR-62 and JIRA:XSTR-211, New SingeValueConverter allows light weight converters if the value can be represented by a unique string.
- Aliasing of classes of a specific type.
- JIRA:XSTR-239, Support for certain types of proxies generated with the CGLIB Enhancer.
- JIRA:XSTR-90 and JIRA:XSTR-311, Support for BEA JRockit starting with R25.1.0 (contributed by Henrik Ståhl of BEA).
Technology preview
- Experimental binary reader and writer.
- Experimental HierarichicalStreamCopier allows streams to be copied from one format to another without the overhead of serialization.
- Experimental JSON support allows streams to be copied from one format to another without the overhead of serialization (contributed by Paul Hammant).
Minor changes
- JIRA:XSTR-266, XStream fails to serialize elements of a unserializable class, that is a base class of a derived class
- JIRA:XSTR-236, Priority constants for converter registration are now public
- JIRA:XSTR-215, XStream writes now fields in declaration order even for JVMs reporting them in reverse order like IBM JDK.
- JIRA:XSTR-276 and JIRA:XSTR-283, XStream does no longer attempt to create references to implicit element.
- JIRA:XSTR-244, Closing a Writer can now be done twice, but any write attempt will later on fail.
- JIRA:XSTR-243, Transient fields were unmarshalled from XML.
- JIRA:XSTR-250, Providing a mapper to the XStream constructor will no longer result in a NPE.
- JIRA:XSTR-281, After registering a new converter, the internal converter cache is now cleared.
- JIRA:XSTR-284, XStream checks the object returned by a converter for compatibility.
- XStream no longer fails serializing a Throwable without cause when no references shall be written.
- Converter for java.awt.font.TextAttribute.
- Converter for java.nio.charset.Charset.
- JIRA:XSTR-286, XStream detects impossible self serialization and throws now an appropriate ConversionException.
- JIRA:XSTR-291, XomDriver implementation added.
- JIRA:XSTR-299, Fix for implicit collections with items using the same name as the field name of the underlying collection.
- JIRA:XSTR-245, Broken XML with custom serialization in certain cases (patch contributed by Cyrille Le Clerc).
- JIRA:XSTR-304, Bad handling of repairing namespace flag for StaxDriver (patch contributed by John Kristian).
API changes
- JIRA:XSTR-252, Refactored support for XML friendly character mapping.
- JIRA:XSTR-69, Refactored ReflectionConverter allows simpler subclassing.
- Unmarshalling context has now an overloaded version of the method convertAnother to provide the Converter directly.
- Deprecate ClassMapper for Mapper. All methods with a ClassMapper parameter have now a duplicate taking only a Mapper. The variant with the ClassMapper is deprecated.
- Deprecate c.t.x.alias.CannotResolveClassException for c.t.x.mapper.CannotResolveClassException.
- Deprecate NameMapper (was not used within XStream anymore anyway).
- Deprecate constructor of DefaultMapper taking an alternative name for the class attribute. Use the aliasAttribute method.
- Deprecate attributeForImplementationClass, attributeForClassDefiningField, attributeForReadResolveField, and attributeForEnumType in favour of the generalized aliasForAttribute in the Mapper interface.
- Removed all deprecated stuff from 1.1.x and 1.0.x
- JIRA:XSTR-211, A lot of existing (basic) Converters have been refactored to use the new SingleValueConverter interface.
- Dom4JWriter uses now a DocumentFactory and a XMLWriter as constructor arguments.
Version 1.1.3
Released 13 January 2006.
Major changes
- Added XStream.toXML(OutputStream) and XStream.fromXML(InputStream).
- Ability to prevent fields from being serialized by calling XStream.omitField() or by implementing Mapper.shouldSerializeMember().
- Added Converter for Enum, EnumMap and EnumSet
- JIRA:XSTR-186, Added BeanConverter (contributed by Andrea Aime)
- JIRA:XSTR-246, Added ISO8601SqlTimestampConverter (contributed by Cheong, Chung-Onn)
- Added ISO8601GregorianCaledarConverter
- JIRA:XSTR-215, Fixed support for IBM JVM (contributed by Gabor Liptak)
- Enhanced mode support for Blackdown JDK
- JIRA:XSTR-265, support for javax.security.auth.Subject
- JIRA:XSTR-233, support for Integer[] arrays
Minor changes
- Remove unnecessary PrintWriter wrapper in default writers (pointed out by Mathieu Champlon)
- Bugfix: EnumSet converter can now deal with empty sets (contributed by Baba Buehler)
- Update ISO8601DateConverter to use Joda 1.0
- JIRA:XSTR-242, GregorianCalenderConverter saves now the timezone
- JIRA:XSTR-247, ISO8601DateConverter now independent on timezone
- JIRA:XSTR-263, Circular references with Externalizable objects fail
API changes
Version 1.1.2
Released Apr 30, 2005. Most popular feature requests implemented. Java 5 Enum support. Serialization of JavaBeans using
accessors. Aliasing of fields. StAX integration, with namespaces. Improved support on JDK 1.3 and IBM JDK.
Major changes
- JIRA:XSTR-186, Option to serialize JavaBeans using public accessors, rather than private fields (contributed by Andrea Aime).
- Ability to alias fields as well as classes, using XStream.addFieldAlias().
- JIRA:XSTR-70, JIRA:XSTR-204 Support for JDK 5 enums (contributed by Eric Snell and Bryan Coleman).
- JIRA:XSTR-206 Clean representation of JDK 5 EnumMap and EnumSet.
- XStream can now be built using JDK 1.3 (previously it required JDK 1.4 to compile, but 1.3 to run).
- JIRA:XSTR-215, Enhanced mode is now supported on the IBM 1.4 JDK.
- The default HierarchicalStreamWriter implementation is supplied by the HierarichicalStreamDriver (as well as the reader).
Minor changes
- JIRA:XSTR-104 HierarchicalStreamReader now exposes all available attributes to the Converter implementations (contributed by Trygve Laugstol).
- Bugfix: Externalizable deserialization supported for objects not at the root of tree.
- JavaMethodConverter handles non public methods/constructors (contributed by Kevin Ring).
- PropertiesConverter also serializes default properties, if present (contributed by Kevin Ring).
- Bugfix: In some cases, XppReader and StaxReader would get confused when calling hasMoreChildren() and getValue() on the same node.
- JIRA:XSTR-217, ISO8601DateConverter now requires joda-time-1.2.1
- PrettyPrintWriter and CompactWriter may have their text/attribute escaping rules customized by overriding writeText() and writeAttributeValue().
API changes
- HierarchicalStreamDriver implementations now require a createWriter() method. The simplest implementation is to return a new PrettyPrintWriter.
- Introduced ReaderWrapper/WriterWrapper classes to make it easier to wrap (decorate) HierarchicalStreamReader/Writer instances.
Version 1.1.1
Released Mar 7, 2005. Mostly bugfixes and minor feature enhancements.
Major changes
- Converters can be registered with a priority, allowing more generic filters to handle classes that don't have more specific converters.
- Converters can now access underlying HierarchicalStreamReader/Writer implementations to make implementation specific calls.
- Improved support for classes using ObjectInputFields to follow the serialization specification.
- JIRA:XSTR-179 Support for ObjectInputStream.registerValidation(ObjectInputValidation).
- JIRA:XSTR-178 Serialized inner class now maintains reference to outer class.
- JIRA:XSTR-199 Default ClassLoader may be changed using XStream.setClassLoader().
Minor changes
- Bugfix: Thread context classloader is loaded by the correct thread. (Thanks to Padraic Renaghan for pointing this out).
- Bugfix: Default implementations of aliased classes were not being deserialized by SerializableConverter.
- Bugfix: JIRA:XSTR-180 Serializable objects support defaultReadObject() even when no default fields available.
- Bugfix: For serialized objects class hierarchy is serialized starting with superclass (as per Java Object Serialization).
- Bugfix: readObject() is now called for classes containing only transient fields.
- Bugfix: Order of fields are maintained when calling ObjectOutputStream.putFields().
- Bugfix: FontConverter extended to support FontUIResource which does some awkward native calls.
- Bugfix: Deserialization of very complicated graphs (such as Swing components) sometimes resulted in broken object references. Now fixed.
- Bugfix: JIRA:XSTR-188 Classes that use readResolve()/writeReplace() can now return different types.
- Bugfix: JIRA:XSTR-185, JIRA:XSTR-195 Support for loading of array classes for classes that have not yet been loaded. (Thanks to Henri Tremblay and Simon Daniel)
- Bugfix: JIRA:XSTR-190 PrettyPrintWriter and CompactWriter escape characters in XML attributes.
- Bugfix: JIRA:XSTR-176, JIRA:XSTR-196 The XStream ObjectInputStream and ObjectOutputStream implementations now propegate the flush() and close() events to the underlying streams.
- Bugfix: JIRA:XSTR-192 Implicit collection mappings are now supported in inheritance hierarchies.
API changes
- ClassMapper is now deprecated. Replaced with MapperWrapper.
- HierarchicalStreamWriter implementations must now implement close(), flush() and underlyingWriter().
- HierarchicalStreamReader implementations must now implement close() and underlyingReader().
Version 1.1
Released Jan 15, 2005. Focus on support for objects defining custom serialization using the standard
Java serialization mechanism.
Major changes
- Provides drop in replacement for ObjectInputStream and ObjectOutputStream, using XStream.createObjectInputStream() and
XStream.createObjectOutputStream() and XStream.createObjectInputStream(). This provides support for streaming objects.
- Support for objects that specify their own serialization schemes by implementing readObject() and writeObject()
(as in Java serialization spec). This includes support for ObjectInputStream.getFields() and ObjectOuputStream.putFields().
- Support for objects to serialize other objects to the stream by implementing writeReplace() (as in Java serialization spec).
- Support for any object that performs custom serialization by implementing java.io.Externalizable (as in Java serialization spec).
- Implicit collections can be specified for classes, allowing the element wrapping the collection to be skipped.
- New writer implementations to allow XStream to serialize directly to a SAX stream or TrAX pipeline.
- The MarshallingContext and UnmarshallingContext interfaces now extend DataHolder, allowing arbitrary data to be stored
by the user whilst walking the object graph and passed around to Converters. DataHolders can also be passed into
XStream from the outside.
- Includes new DomWriter implementation to serialize directly to a W3C DOM tree (to complement the existing DomReader).
- Better support for instantiating objects on non Sun 1.4+ JVMs, including non-public constructors, private static inner classes and
ANY class that implements java.io.Serializable.
- DOM, DOM4J, JDOM, XOM, Electric-XML, SAX, STAX
- Specific ClassLoaders can be passed into XStream, to allow for greater compatibility in J2EE containers.
- Ability to change the default converter
- Added optional ISO8601DateConverter for full ISO8601 date format support. The converter is not registered by default
as it requires the joda-time dependency (http://joda-time.sf.net). To use, ensure joda-time is in classpath and register explicitly.
- Enhanced mode is now supported on the Apple 1.4 JDK.
Minor changes
- PrettyPrintWriter only flushes stream when necessary - large performance improvement for serialization.
- Added XStream.fromXml(xml, root) convenience methods for deserializing into an existing root object.
- JDK 1.3 compatibility: Added mechanism for accessing nested exception.
- JDK 1.3 compatibility: GregorianCalendarConverter only calls Calendar.getTimeInMillis() the JDK supports it.
- Bugfix: All caches are now synchronized - there were some thread safety issues.
- Bugfix: Only immutable basic types will have references ignored in XML (for clarity).
- Bugfix: Class names can contain underscores.
- Bugfix: Support for '\0' char.
- Bugfix: PropertyConverter no longer attempts to serialize subclasses of Properties.
- Bugfix: JVM detection uses system properties, which is more accurate than searching the classpath.
API changes
- XStream.addDefaultCollection() has been deprecated. Use XStream.addImplicitCollection() instead.
Version 1.0.2
Released Aug 7, 2004. Focus on improving the converters bundled with XStream to support a wider range of types.
Major changes
- XML elements are written in order they are defined in class, rather than alphabetical.
- Converters for java.io.File, java.sql.Timestamp, java.awt.Color, and dynamic proxies are now
registered by default.
- EncodedByteArrayConverter is now registered by default and uses a single Base64 string to store the contents
of a byte[]. This now works on all JVMs as it no longer relies on Sun specific classes. This converter will also
unmarshal byte[] that have been serialized without it, for backwards compatability.
- New converters for java.sql.Time, java.sql.Date, java.util.Locale, java.util.Currency, java.util.Calendar
and java.awt.Font.
- All caching is done in XStream instance instead of statics, allowing applications that use hot redeployment
of classes to use XStream in a parent classloader.
- XStream will fail fast if a field value is defined more than once in XML when deserializing.
Minor changes
- The <entry> element used in Maps can now be specified by creating an alias for java.util.Map.Entry.
- Bugfix: Fields with characters that generate invalid XML (such as $ signs) are now escaped.
- Bugfix: Pre-instantiated objects can be unmarshalled through multiple levels.
API changes
Version 1.0.1
Released May 30, 2004. Misc features and bugfixes.
Major changes
- Support for multidimensional arrays.
- Object with readResolve() method will be treated the same way native serialization treats them.
Minor changes
- New converters for Throwable and StackTraceElement that retain stack trace (JDK 1.4 only)
- Bugfix: System.identityHashCode() is not guaranteed to be unique. Ensure reference checking is used as well.
- Bugfix: Allows user classes to be defined in WEB-INF/classes in Servlet environments. Tries to use context classloader if available.
- Support for java.util.Currency (through readResolve()).
- Instances of Jakarta Commons Lang Enum are now reused (through readResolve()).
- Bugfix: JavaClassConverter handles primitive type classes (contributed by Matthew Sandoz).
API changes
- Additional method: ConverterLookup.defaultConverter(). Custom implementations of this class should implement
this new method.
Version 1.0
Released May 14, 2004. Focusses on finalizing the API for 1.0 release.
Major changes
- Supports fields of same name, hidden by inheritance.
Minor changes
- JavaDoc for most important parts of API.
API changes
- The ReflectionConverter and ReflectionProviders have had an overhaul to support
hidden fields. Most methods now take an extra argument to specify which class a field
is declared in.
Version 1.0 (release candidate 1)
Released May 9, 2004. Focusses on finalizing the API for 1.0 release.
Major changes
- JDK 1.3 compatibility.
- Informative error messages.
- Defaults to using faster XPP based parser.
- Serializes final field under JDK 1.4.
- Fail fast when trying to serialize final field if not Sun 1.4 JRE.
Minor changes
- Misc performance improvements.
- Converters for TreeMap and TreeSet that store the Comparator.
API changes
- Default constructor for XStream class uses XppDriver instead of DomDriver.
To use DomDriver, explicitly pass it in to the constructor.
- Exception is thrown if trying to serialize an object that contains a
final field if not Sun 1.4 JRE.
About XStream version numbers...
Version 0.6
Released May 7, 2004. Focusses on providing full object graph support.
Major changes
Minor changes
- Bugfix: Objects that had no children could not be derefenced properly (thanks to Brian Slesinsky and Nick Pomfret).
- Bugfix: DateConverter is now thread safe.
- Optimization: String instances are reused as much as possible.
- Converters for BigInteger and BigDecimal.
- IntConverter now recognises hexadecimal and octal notations (thanks to Konstantin Pribluda).
API changes
Version 0.6 (release candidate 1)
Released April 19, 2004. Focusses on providing full object graph support.
Major changes
- Full support for object graphs, including duplicate references of same object and
circular references.
- References can be identified using XPath (default), unique-IDs or disabled.
Minor changes
- Release includes Ant build file.
- Converters for non standard collections such as Collections.EMPTY_LIST, syncronizedList(), unmodifiableMap(), etc.
- Converter for nulls.
- Converter for dynamic proxies.
- Converter for java.net.URL.
- Converters for java.util.LinkedHashMap and java.util.LinkedHashSet.
- Converters for java.lang.reflect.Method and java.lang.reflect.Constructor.
- If duplicate reference support is disabled and a circular reference is encountered, an exception will be thrown.
API changes
Version 0.5
Released March 8, 2004. Focussed on performance.
Major changes
- Massive performance improvements. Up to 3 times faster for serialization and 22
times faster for deserialization!
- Non-DOM building pull parser based reader. Results in much smaller memory footprint,
particularly when deserializing large object models.
Minor changes
- Misc performance improvements.
- Misc bugfixes.
- Alternate encodings can be used with DomDriver.
API changes
- Renamed XMLReader/Writer to HierarchicalStreamReader/Writer as XStream is not
actually coupled to serializing just to XML.
- Cleaned up the public API.
- Moved internal XStream implementation classes to core package.
- Misc package/class renames to make more sense. Dumped lots of dead code.
Version 0.4
This version was never publicly released. All changes were made available in 0.5. Focussed on making it easier to create custom converters.
Major changes
- Overhaul of interface for Converters. Makes Converters much cleaner to write.
Minor changes
- Added custom converters for java.io.File, java.util.Properties, java.util.Vector, java.util.Hashtable, java.util.BitSet
byte[] (Base64 encoded), char[].
- Misc bugfixes.
API changes
- New interface to be implemented by custom converters.
Version 0.3
Released January 1, 2004.
Major changes
- Added ElementMapper interface and default implementations to allow fine
grained control over element name to class mapper operations.
- Added an XPP based reader and writer that uses a pull-parser to create a lightweight DOM tree.
Minor changes
- Added XStream.fromXML(XMLReader xmlReader,Object root) method to
allow the population of an object graph starting with a live object root.
- Added XMLReader.peek() method to allow access to the underlying hierarchical
object being unmarshalled.
API changes
- Aligned the the methods in XStream to use the specified ObjectFactory in the constructor
instead of creating a SunReflectionObjectFactory.
Older versions
Changes in XStream prior to version 0.3 were not logged.