org.springframework.beans.factory.support
Class ManagedSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by java.util.LinkedHashSet<E>
                  extended by org.springframework.beans.factory.support.ManagedSet<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>, BeanMetadataElement, Mergeable

public class ManagedSet<E>
extends java.util.LinkedHashSet<E>
implements Mergeable, BeanMetadataElement

Tag collection class used to hold managed Set values, which may include runtime bean references (to be resolved into bean objects).

Since:
21.01.2004
Author:
Juergen Hoeller, Rob Harrop
See Also:
Serialized Form

Field Summary
private  java.lang.String elementTypeName
           
private  boolean mergeEnabled
           
private  java.lang.Object source
           
 
Constructor Summary
ManagedSet()
           
ManagedSet(int initialCapacity)
           
 
Method Summary
 java.lang.String getElementTypeName()
          Return the default element type name (class name) to be used for this set.
 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.Set<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 set.
 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.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

source

private java.lang.Object source

elementTypeName

private java.lang.String elementTypeName

mergeEnabled

private boolean mergeEnabled
Constructor Detail

ManagedSet

public ManagedSet()

ManagedSet

public ManagedSet(int initialCapacity)
Method Detail

setSource

public void setSource(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.


getSource

public java.lang.Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

setElementTypeName

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


getElementTypeName

public java.lang.String getElementTypeName()
Return the default element type name (class name) to be used for this set.


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.Set<E> merge(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