Class KeyValueMapAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,Map<String,String>>
de.hybris.platform.cmswebservices.jaxb.adapters.KeyValueMapAdapter
public class KeyValueMapAdapter
extends javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,Map<String,String>>
This Adapter is used to convert
Map<String, String> into XML/JSON objects, and vice-versa,
where the entries are represented as
Key/Value pairs, as opposed to an array representation.
Example:
public class Container
{
private Map<String, String> value;
}
would have the following JSON representation:
{
"value": {
"key1": "value1",
"key2": "value2"
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class represents a simple key-value entry in a map.static classThis class represents a key value map. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
KeyValueMapAdapter
public KeyValueMapAdapter()
-
-
Method Details
-
marshal
- Specified by:
marshalin classjavax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,Map<String, String>> - Throws:
Exception
-
unmarshal
public Map<String,String> unmarshal(KeyValueMapAdapter.KeyValueAdaptedMap adaptedMap) throws Exception - Specified by:
unmarshalin classjavax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,Map<String, String>> - Throws:
Exception
-