InterviewSolution
| 1. |
Why Is My Element Not Written As Xml Attribute Although I Have Configured It? |
|
Answer» You can only write types as attributes that are represented as a single String value and are handled THEREFORE by SingleValueConverter IMPLEMENTATIONS. If your type is handled by a Converter implementation, the configuration of XSTREAM to write an ATTRIBUTE (USING XStream.useAttributeFor() or @XStreamAsAttribute) is simply ignored. You can only write types as attributes that are represented as a single String value and are handled therefore by SingleValueConverter implementations. If your type is handled by a Converter implementation, the configuration of XStream to write an attribute (using XStream.useAttributeFor() or @XStreamAsAttribute) is simply ignored. |
|