[Simple-support] Simple 2.5
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-04-08 15:05:40
|
Hi,
I have released Simple 2.5. This release contains a set of new annotations.
@Variant
@VariantList
@VariantMap
This allows constructs such as
@Variant({
@Element(name="login"),
@Element(name="account"),
@Element(name="username"),
@Element(name="id"),
@Element(name="name")
})
private final String name;
And for lists
@VariantList({
@ElementList(entry="double", inline=true, type=DoubleEntry.class),
@ElementList(entry="text", inline=true, type=StringEntry.class),
@ElementList(entry="int", inline=true, type=IntegerEntry.class)
})
private List<Entry> list;
This allows dynamic serialization of types, matched by type on serialization and on XML element name for deserialization. This also ensures there is no need for class= attributes to determine the type and makes the generated XML more transparent.
Regards,
Niall
|