Hi Roland,
Roland Roberts wrote:
> On 08/31/2012 09:12 AM, Joe Walnes wrote:
>> Hi Roland
>>
>> I'm afraid sticking with your custom Converter is the best option I see.
>
> Bummer. The existing custom Converter has some duplicate information in
> it. I was hoping to make the argument that I could simplify the code by
> switching to annotations as the basis for getting rid of the duplication.
>
> Would such a change be considered a reasonable enhancement in spite of
> the implication for unmarshalling?
well, as documented, an implicit map can only work, if the key is part of
the map's value. However, if this "value" is an own structure, you can
annotate the field in the structure itself to be written as attribute:
class Container {
@XStreamImplicit(itemFieldName="component", keyFieldName="name")
Map<String, Component> map;
}
class Component {
@XStreamAsAttribute
String name;
...
}
Should give you, what you want.
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email