org.springframework.beans.factory.support

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:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess, BeanMetadataElement, Mergeable
    Direct Known Subclasses:
    ManagedArray


    public class ManagedList<E>
    extends java.util.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
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor and Description
      ManagedList() 
      ManagedList(int initialCapacity) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getElementTypeName()
      Return the default element type name (class name) to be used for this list.
      java.lang.Object getSource()
      Return the configuration source Object for this metadata element (may be null).
      boolean isMergeEnabled()
      Is merging enabled for this particular instance?
      java.util.List<E> merge(java.lang.Object parent)
      Merge the current value set with that of the supplied object.
      void setElementTypeName(java.lang.String elementTypeName)
      Set the default element type name (class name) to be used for this list.
      void setMergeEnabled(boolean mergeEnabled)
      Set whether merging should be enabled for this collection, in case of a 'parent' collection value being present.
      void setSource(java.lang.Object source)
      Set the configuration source Object for this metadata element.
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractList

        equals, hashCode
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.List

        containsAll, equals, hashCode
      • Methods inherited from interface java.util.Collection

        parallelStream, stream
    • Constructor Detail

      • ManagedList

        public ManagedList()
      • ManagedList

        public ManagedList(int initialCapacity)
    • Method Detail

      • setSource

        public void setSource(@Nullable
                              java.lang.Object source)
        Set the configuration source Object for this metadata element.

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

      • setElementTypeName

        public void setElementTypeName(java.lang.String elementTypeName)
        Set the default element type name (class name) to be used for this list.
      • getElementTypeName

        @Nullable
        public java.lang.String getElementTypeName()
        Return the default element type name (class name) to be used for this list.
      • setMergeEnabled

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

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

        public java.util.List<E> merge(@Nullable
                                       java.lang.Object parent)
        Description copied from interface: 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 in interface Mergeable
        Parameters:
        parent - the object to merge with
        Returns:
        the result of the merge operation