Annotation Interface JsonXmlMap


@Retention(RUNTIME) @Target({TYPE,FIELD}) public @interface JsonXmlMap

This annotation must be used with the JsonXmlMapModule. The module is registered automatically for XML source if you are using BeanMapper. Use this annotation only when you wish to overwrite default settings via its attributes. It is otherwise of no use.

Since:
3.0.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Field name to use for each map entries when serializing as XML.
    Field name to use for each map entry keys when serializing as XML.
    Concrete key type to use when deserializing.
    Concrete Map type to use when deserializing.
    Field name to use for each map entry values when serializing as XML.
    Concrete value type to use when deserializing.
  • Element Details

    • entryName

      String entryName
      Field name to use for each map entries when serializing as XML. This name does not affect reading. The default behavior uses basic heuristics to detect whether the collection property name is plural and can make a singular variant of it. It it can't figure it out, it falls back to "entry". Given the plural detection logic's simplicity, it won't always get it right. Use this attribute to ensure the exact name you want.
      Returns:
      entry field name, when writing XML
      Default:
      ""
    • keyName

      String keyName
      Field name to use for each map entry keys when serializing as XML. Default is "key".
      Returns:
      entry key field name, when writing XML
      Default:
      "key"
    • valueName

      String valueName
      Field name to use for each map entry values when serializing as XML. Default is "value".
      Returns:
      entry value field name, when writing XML
      Default:
      "value"
    • mapType

      Class<?> mapType
      Concrete Map type to use when deserializing. Has to be assignable to the type of your Map property. Default will try to detect and use HashMap as fallback.
      Returns:
      map concrete type
      Default:
      java.lang.Void.class
    • keyType

      Class<?> keyType
      Concrete key type to use when deserializing. Has to be assignable to the type of your Map entry key property. Default will try to detect.
      Returns:
      map entry key concrete type
      Default:
      java.lang.Void.class
    • valueType

      Class<?> valueType
      Concrete value type to use when deserializing. Has to be assignable to the type of your Map entry value property. Default will try to detect.
      Returns:
      map entry value concrete type
      Default:
      java.lang.Void.class