Annotation 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 ElementsModifier and TypeOptional ElementDescriptionField name to use for each map entries when serializing as XML.Field name to use for each map entry keys when serializing as XML.Class<?> Concrete key type to use when deserializing.Class<?> Concrete Map type to use when deserializing.Field name to use for each map entry values when serializing as XML.Class<?> Concrete value type to use when deserializing.
-
Element Details
-
entryName
String entryNameField 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 keyNameField 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 valueNameField 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<?> mapTypeConcrete Map type to use when deserializing. Has to be assignable to the type of your Map property. Default will try to detect and useHashMapas fallback.- Returns:
- map concrete type
- Default:
java.lang.Void.class
-
keyType
Class<?> keyTypeConcrete 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<?> valueTypeConcrete 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
-