public class MapAdapter extends XmlAdapter<Map,Map<String,Object>>
Map
is serialized by default as a list of entries. This is fine for XML but not that nice for JSON
when the map keys are strings. We would like the Map
to be serialized as a list of entries when the
output format is XML and as a JSON object when the output format is JSON. This adapter allows us to use
Map
in the REST resource that retrieves the class property values, while the XML serialization will
be done using the schema-generated Map
.Constructor and Description |
---|
MapAdapter() |
Copyright © 2004–2021 XWiki. All rights reserved.