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

<init>

CustomCollectionEditor(collectionType: Class<out MutableCollection<Any?>>)

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

Parameters

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

See Also
java.util.Collectionjava.util.ArrayListjava.util.TreeSetjava.util.LinkedHashSet

CustomCollectionEditor(collectionType: Class<out MutableCollection<Any?>>, nullAsEmptyCollection: Boolean)

Create a new CustomCollectionEditor 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 Collection type or an array, it will be converted to a default implementation of the given Collection type. If the value is anything else, a target Collection with that single value will be created.

The default Collection implementations are: ArrayList for List, TreeSet for SortedSet, and LinkedHashSet for Set.

Parameters

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

nullAsEmptyCollection - whether to convert an incoming null value to an empty Collection (of the appropriate type)

See Also
java.util.Collectionjava.util.ArrayListjava.util.TreeSetjava.util.LinkedHashSet