spring-framework / org.springframework.beans.propertyeditors / CustomMapEditor / <init>

<init>

CustomMapEditor(mapType: Class<out MutableMap<Any?, Any?>>)

Create a new CustomMapEditor for the given target type, keeping an incoming null as-is.

Parameters

mapType - the target type, which needs to be a sub-interface of Map or a concrete Map class

See Also
java.util.Mapjava.util.HashMapjava.util.TreeMapjava.util.LinkedHashMap

CustomMapEditor(mapType: Class<out MutableMap<Any?, Any?>>, nullAsEmptyMap: Boolean)

Create a new CustomMapEditor for the given target type.

If the incoming value is of the given type, it will be used as-is. If it is a different Map type or an array, it will be converted to a default implementation of the given Map type. If the value is anything else, a target Map with that single value will be created.

The default Map implementations are: TreeMap for SortedMap, and LinkedHashMap for Map.

Parameters

mapType - the target type, which needs to be a sub-interface of Map or a concrete Map class

nullAsEmptyMap - ap whether to convert an incoming null value to an empty Map (of the appropriate type)

See Also
java.util.Mapjava.util.TreeMapjava.util.LinkedHashMap