org.springframework.beans.factory.support
public class: ManagedSet [javadoc |
source]
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
java.util.LinkedHashSet
org.springframework.beans.factory.support.ManagedSet
All Implemented Interfaces:
Mergeable, BeanMetadataElement, Set, Serializable, Cloneable, Collection
Tag collection class used to hold managed Set values, which may
include runtime bean references (to be resolved into bean objects).
- author:
Juergen - Hoeller
- author:
Rob - Harrop
- since:
21.01.2004 -
| Methods from java.util.AbstractCollection: |
|---|
|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Method from org.springframework.beans.factory.support.ManagedSet Detail: |
public Object getSource() {
return this.source;
}
|
public boolean isMergeEnabled() {
return this.mergeEnabled;
}
|
public Object merge(Object parent) {
if (!this.mergeEnabled) {
throw new IllegalStateException("Not allowed to merge when the 'mergeEnabled' property is set to 'false'");
}
if (parent == null) {
return this;
}
if (!(parent instanceof Set)) {
throw new IllegalArgumentException("Cannot merge with object of type [" + parent.getClass() + "]");
}
Set merged = new ManagedSet();
merged.addAll((Set) parent);
merged.addAll(this);
return merged;
}
|
public void setMergeEnabled(boolean mergeEnabled) {
this.mergeEnabled = mergeEnabled;
}
Set whether merging should be enabled for this collection,
in case of a 'parent' collection value being present. |
public void setSource(Object source) {
this.source = source;
}
|