org.springframework.beans.factory.support
public class: ManagedMap [javadoc |
source]
java.lang.Object
java.util.AbstractMap
java.util.HashMap
java.util.LinkedHashMap
org.springframework.beans.factory.support.ManagedMap
All Implemented Interfaces:
Mergeable, BeanMetadataElement, Map, Serializable, Cloneable
Tag collection class used to hold managed Map values, which may
include runtime bean references (to be resolved into bean objects).
- author:
Juergen - Hoeller
- author:
Rob - Harrop
- since:
27.05.2003 -
| Methods from java.util.HashMap: |
|---|
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods from java.util.AbstractMap: |
|---|
|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values |
| Method from org.springframework.beans.factory.support.ManagedMap 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 Map)) {
throw new IllegalArgumentException("Cannot merge with object of type [" + parent.getClass() + "]");
}
Map merged = new ManagedMap();
merged.putAll((Map) parent);
merged.putAll(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;
}
|