public class MapAdapter<K,V> extends javax.xml.bind.annotation.adapters.XmlAdapter<JAXBUtils.MapImp<K,V>,java.util.Map<K,V>>
XmlAdapter
implementation that converts a Map
object
into a wrapper that holds a List
of elements that correspond
to the entries in the map. Both the marshal(Map)
and
#unmarshal(MapImp)
method ignore null-mappings, i.e. they
will ignore each entry that maps its key to a null
value. This is
done to help minimize the amount of xml data being generated. If it is
required to preserve null
values (e.g. the mere existence of a key
in the map is checked for) then it is recommended to implement a special
adapter or use dummy values.Constructor and Description |
---|
MapAdapter() |
public java.util.Map<K,V> unmarshal(JAXBUtils.MapImp<K,V> v) throws java.lang.Exception
unmarshal
in class javax.xml.bind.annotation.adapters.XmlAdapter<JAXBUtils.MapImp<K,V>,java.util.Map<K,V>>
java.lang.Exception
XmlAdapter.unmarshal(java.lang.Object)
public JAXBUtils.MapImp<K,V> marshal(java.util.Map<K,V> v) throws java.lang.Exception
marshal
in class javax.xml.bind.annotation.adapters.XmlAdapter<JAXBUtils.MapImp<K,V>,java.util.Map<K,V>>
java.lang.Exception
XmlAdapter.marshal(java.lang.Object)