Jorg,
thank you for quick reply.

And is there a way for the converter to build output

<a id="map_key">map_value</a>

without implicit anotation ?
I don't need to use annotation, API would be also good.

Martin

2012/5/23 Jörg Schaible <[email protected]>

> Hi Martin,
>
> Martin Minka wrote:
>
> > I would like to produce from a HashMap following XML:
> > <a id="map_key">map_value</a>
> >
> > I tried:
> > @XStreamImplicit(keyFieldName = "a")
> > @XStreamConverter(MyMapConverter.class)
> > HashMap<String, String> map = new HashMap<String, String>();
> >
> > But this combination never enters MyMapConverter.
> >
> > Is there a way to achieve this ?
>
> No. Implicit collections/arrays/maps are a hack in the generic converters
> (e.g. ReflectionConverter) to skip the "implicit" container and write their
> elements like own elements. Therefore is no converter required/called for
> the map. Your converter is only called without the implicit declaration.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to