x-stream / xstream

Serialize Java objects to XML and back again.
http://x-stream.github.io
Other
749 stars 227 forks source link

Is there any annotations can support both attribute and sub tags #344

Closed seiyafei closed 1 year ago

seiyafei commented 1 year ago

`

BBBBB
<parm name="CCC">DDDDD</parm>

`

Is there any annotations can support both attribute and sub tags like this?How should my class be written?

joehni commented 1 year ago

You can use the ToAttributedValueConverter and register it either for a specific type or as local converter. Registration of a converter can be done with annotation XStreamConverter. See unit test c.t.acceptance.annotations.ParameterizedConverterTest for examples.