[
https://jira.codehaus.org/browse/XSTR-686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joerg Schaible resolved XSTR-686.
---------------------------------
Resolution: Not A Bug
Sorry, but there's nothing to fix. You can use an implicit map only, if the
values contain their key (see Javadoc for *keyFieldName*) i.e. one of the
values' field is used for its key in the map. The implicit map feature
explicitly drops the key, because it is redundant for the use case. The types
you've used in your example misses this relation. Therefore nothing properly
can be generated. For further questions on the topic, please use the user's
list.
> Implicit collection fail
> ------------------------
>
> Key: XSTR-686
> URL: https://jira.codehaus.org/browse/XSTR-686
> Project: XStream
> Issue Type: Bug
> Components: Annotations
> Affects Versions: 1.4.2
> Reporter: Dominik Derwinski
> Assignee: Joerg Schaible
> Priority: Minor
> Fix For: Upcoming
>
> Attachments: Test2.java
>
>
> When I specify itemFieldName and keyFieldName in @XStreamImplicit annotation,
> key field is not saved to xml:
> with @XStreamImplicit
> <test>
> <entry>
> <string>v1</string>
> <string>abc</string>
> </entry>
> </test>
> with @XStreamImplicit(keyFieldName="key", itemFieldName="item")
> <test>
> <item>abc</item>
> </test>
> Also, @XStreamImplicit is not equivalent to XStream.addImplicit... methods as
> it lacks parameters from it's variants.
> Also, XStream.addImplicitMap lacks parameter to specify keyType (as is
> possible to specify itemType).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
<a
href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>
</p>