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
,BeanMetadataElement
,Mergeable
- Direct Known Subclasses:
ManagedArray
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:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the default element type name (class name) to be used for this list.Return the configuration sourceObject
for this metadata element (may benull
).boolean
Is merging enabled for this particular instance?Merge the current value set with that of the supplied object.static <E> ManagedList<E>
of
(E... elements) Create a new instance containing an arbitrary number of elements.void
setElementTypeName
(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
Set the configuration sourceObject
for this metadata element.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, 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.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
ManagedList
public ManagedList() -
ManagedList
public ManagedList(int initialCapacity)
-
-
Method Details
-
of
Create a new instance containing an arbitrary number of elements.- Type Parameters:
E
- theList
'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
Set the configuration sourceObject
for this metadata element.The exact type of the object will depend on the configuration mechanism used.
-
getSource
Description copied from interface:BeanMetadataElement
Return the configuration sourceObject
for this metadata element (may benull
).- Specified by:
getSource
in interfaceBeanMetadataElement
-
setElementTypeName
Set the default element type name (class name) to be used for this list. -
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 interfaceMergeable
-
merge
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.
-