Class ManagedList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.springframework.beans.factory.support.ManagedList<E>
Type Parameters:
E - the element type
All Implemented Interfaces:
serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, sequencedCollection<E>, BeanMetadataElement, Mergeable
Direct Known subclasses:
ManagedArray

public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetadataElement
Tag collection class used to hold managed List elements, which may include runtime bean references (to be resolved into bean objects).
since:
27.05.2003
Author:
Rod Johnson, Rob Harrop, Juergen Hoeller, stephane Nicoll, sam Brannen
see Also:
  • Constructor Details

    • ManagedList

      public&nbsp;ManagedList()
    • ManagedList

      public&nbsp;ManagedList(int&nbsp;initialCapacity)
  • Method Details

    • of

      @safeVarargs public static&nbsp;<E>&nbsp;ManagedList<E>&nbsp;of(E...&nbsp;elements)
      Create a new instance containing an arbitrary number of elements.
      Type Parameters:
      E - the List's element type
      Parameters:
      elements - the elements to be contained in the list
      Returns:
      a ManagedList containing the specified elements
      since:
      5.3.16
    • setsource

      public&nbsp;void&nbsp;setsource(@Nullable Object&nbsp;source)
      set the configuration source Object for this metadata element.

      The exact type of the object will depend on the configuration mechanism used.

    • getsource

      public&nbsp;@Nullable Object&nbsp;getsource()
      Description copied from interface:&nbsp;BeanMetadataElement
      Return the configuration source Object for this metadata element (may be null).
      specified by:
      getsource&nbsp;in interface&nbsp;BeanMetadataElement
    • setElementTypeName

      public&nbsp;void&nbsp;setElementTypeName(string&nbsp;elementTypeName)
      set the default element type name (class name) to be used for this list.
    • getElementTypeName

      public&nbsp;@Nullable string&nbsp;getElementTypeName()
      Return the default element type name (class name) to be used for this list.
    • setMergeEnabled

      public&nbsp;void&nbsp;setMergeEnabled(boolean&nbsp;mergeEnabled)
      set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
    • isMergeEnabled

      public&nbsp;boolean&nbsp;isMergeEnabled()
      Description copied from interface:&nbsp;Mergeable
      Is merging enabled for this particular instance?
      specified by:
      isMergeEnabled&nbsp;in interface&nbsp;Mergeable
    • merge

      public&nbsp;List<E>&nbsp;merge(@Nullable Object&nbsp;parent)
      Description copied from interface:&nbsp;Mergeable
      Merge the current value set with that of the supplied object.

      The supplied object is considered the parent, and values in the callee's value set must override those of the supplied object.

      specified by:
      merge&nbsp;in interface&nbsp;Mergeable
      Parameters:
      parent - the object to merge with
      Returns:
      the result of the merge operation