Class KeyValueMapAdapter
- java.lang.Object
-
- javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>
-
- de.hybris.platform.cmswebservices.jaxb.adapters.KeyValueMapAdapter
-
public class KeyValueMapAdapter extends javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>
This Adapter is used to convertMap<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:
would have the following JSON representation:public class Container { private Mapvalue; } { "value": { "key1": "value1", "key2": "value2" } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeyValueMapAdapter.KeyValueAdaptedEntryThis class represents a simple key-value entry in a map.static classKeyValueMapAdapter.KeyValueAdaptedMapThis class represents a key value map.
-
Constructor Summary
Constructors Constructor Description KeyValueMapAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyValueMapAdapter.KeyValueAdaptedMapmarshal(java.util.Map<java.lang.String,java.lang.String> map)java.util.Map<java.lang.String,java.lang.String>unmarshal(KeyValueMapAdapter.KeyValueAdaptedMap adaptedMap)
-
-
-
Method Detail
-
marshal
public KeyValueMapAdapter.KeyValueAdaptedMap marshal(java.util.Map<java.lang.String,java.lang.String> map) throws java.lang.Exception
- Specified by:
marshalin classjavax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>- Throws:
java.lang.Exception
-
unmarshal
public java.util.Map<java.lang.String,java.lang.String> unmarshal(KeyValueMapAdapter.KeyValueAdaptedMap adaptedMap) throws java.lang.Exception
- Specified by:
unmarshalin classjavax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>- Throws:
java.lang.Exception
-
-