org.omnaest.utils.xml
Class JAXBMap<K,V>

java.lang.Object
  extended by org.omnaest.utils.structure.map.decorator.MapDecorator<K,V>
      extended by org.omnaest.utils.xml.JAXBMap<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
Serializable, Map<K,V>

public class JAXBMap<K,V>
extends MapDecorator<K,V>

The JAXBMap is a artificial XmlRootElement for an arbitrary Map instance. It just stores an internal map instance and delegates all Map based methods to it.

Example output:

 <map>
     <entries>
         <entry>
             <key xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">key3</key>
             <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">value3</value>
         </entry>
         <entry>
             <key xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">key2</key>
             <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">value2</value>
         </entry>
         <entry>
             <key xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">key1</key>
             <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">value1</value>
         </entry>
     </entries>
 </map>
 

Author:
Omnaest
See Also:
newInstance(Map), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.omnaest.utils.structure.map.decorator.MapDecorator
map
 
Constructor Summary
protected JAXBMap()
           
protected JAXBMap(Map<K,V> map)
           
 
Method Summary
static
<M extends JAXBMap<K,V>,K,V>
M
newInstance(Map<K,V> map)
          Creates a new Map wrapper.
 
Methods inherited from class org.omnaest.utils.structure.map.decorator.MapDecorator
clear, containsKey, containsValue, entrySet, equals, get, getMap, hashCode, isEmpty, keySet, put, putAll, remove, setMap, size, toString, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JAXBMap

protected JAXBMap()
See Also:
JAXBMap

JAXBMap

protected JAXBMap(Map<K,V> map)
Parameters:
map -
See Also:
JAXBMap
Method Detail

newInstance

public static <M extends JAXBMap<K,V>,K,V> M newInstance(Map<K,V> map)
Creates a new Map wrapper.

Type Parameters:
M -
K -
V -
Parameters:
map -
Returns:


Copyright © 2013. All Rights Reserved.