Class StringKeyObjectValueMapXmlAdapter


  • public class StringKeyObjectValueMapXmlAdapter
    extends javax.xml.bind.annotation.adapters.XmlAdapter<StringKeyObjectValueMap,​java.util.Map<java.lang.String,​java.lang.Object>>
    This is a XmlAdapter for mapping Map<String, Object> instances to classes/instances that both JAXB/XML and JSON can deal with.

    The most important reason for the existence of this class is that it works well with jackson JSON! JaxbMapAdapter, on the other hand, does not!

    • Constructor Detail

      • StringKeyObjectValueMapXmlAdapter

        public StringKeyObjectValueMapXmlAdapter()
    • Method Detail

      • marshal

        public StringKeyObjectValueMap marshal​(java.util.Map<java.lang.String,​java.lang.Object> map)
                                        throws java.lang.Exception
        Specified by:
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<StringKeyObjectValueMap,​java.util.Map<java.lang.String,​java.lang.Object>>
        Throws:
        java.lang.Exception
      • serializeObject

        public static byte[] serializeObject​(java.lang.Object obj,
                                             java.lang.String key)
      • unmarshal

        public java.util.Map<java.lang.String,​java.lang.Object> unmarshal​(StringKeyObjectValueMap xmlMap)
        Specified by:
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<StringKeyObjectValueMap,​java.util.Map<java.lang.String,​java.lang.Object>>
      • deserializeObject

        public static java.lang.Object deserializeObject​(byte[] objBytes,
                                                         java.lang.String className,
                                                         java.lang.String key)