Attribute support has been added - but not using the AttributeConverter interface, which would not have allowed
the reuse of all the converters already developed.
Rather, a new interface SingleValueConverter has been extracted (which most converters already implemented)
and promoted to top-level user API. Implementations of this interface can be serialised to a single String value
and hence be potentially used as attribute.
In addition, attribute aliases need to be registered just like other aliases,
xstream.aliasAttribute("date", Date.class)
where date is the attribute name.
Still todo is the ability to choose the field name.
xstream.aliasAttribute("date", "m_date", Date.class)
Attribute support has been added - but not using the AttributeConverter interface, which would not have allowed
the reuse of all the converters already developed.
Rather, a new interface SingleValueConverter has been extracted (which most converters already implemented)
and promoted to top-level user API. Implementations of this interface can be serialised to a single String value
and hence be potentially used as attribute.
In addition, attribute aliases need to be registered just like other aliases,
xstream.aliasAttribute("date", Date.class)
where date is the attribute name.
Still todo is the ability to choose the field name.
xstream.aliasAttribute("date", "m_date", Date.class)