public class KeyValueMapAdapter extends javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>
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 value;
}
would have the following JSON representation:
{
"value": {
"key1": "value1",
"key2": "value2"
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
KeyValueMapAdapter.KeyValueAdaptedEntry
This class represents a simple key-value entry in a map.
|
static class |
KeyValueMapAdapter.KeyValueAdaptedMap
This class represents a key value map.
|
| Constructor and Description |
|---|
KeyValueMapAdapter() |
| Modifier and Type | Method and Description |
|---|---|
KeyValueMapAdapter.KeyValueAdaptedMap |
marshal(java.util.Map<java.lang.String,java.lang.String> map) |
java.util.Map<java.lang.String,java.lang.String> |
unmarshal(KeyValueMapAdapter.KeyValueAdaptedMap adaptedMap) |
public KeyValueMapAdapter.KeyValueAdaptedMap marshal(java.util.Map<java.lang.String,java.lang.String> map) throws java.lang.Exception
marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>java.lang.Exceptionpublic java.util.Map<java.lang.String,java.lang.String> unmarshal(KeyValueMapAdapter.KeyValueAdaptedMap adaptedMap) throws java.lang.Exception
unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<KeyValueMapAdapter.KeyValueAdaptedMap,java.util.Map<java.lang.String,java.lang.String>>java.lang.ExceptionCopyright © 2018 SAP SE. All Rights Reserved.