org.springframework.binding.value.support
Class DeepCopyBufferedCollectionValueModel

java.lang.Object
  extended by org.springframework.binding.value.support.AbstractPropertyChangePublisher
      extended by org.springframework.binding.value.support.AbstractValueModel
          extended by org.springframework.binding.value.support.BufferedValueModel
              extended by org.springframework.binding.value.support.BufferedCollectionValueModel
                  extended by org.springframework.binding.value.support.DeepCopyBufferedCollectionValueModel
All Implemented Interfaces:
PropertyChangePublisher, ValueModelWrapper, ValueModel

public class DeepCopyBufferedCollectionValueModel
extends BufferedCollectionValueModel

Implementation of a BufferedCollectionValueModel that performs a deep copy on the elements of the collection.

Author:
Larry Streepy

Field Summary
 
Fields inherited from class org.springframework.binding.value.support.BufferedValueModel
BUFFERING_PROPERTY
 
Fields inherited from class org.springframework.binding.value.support.AbstractValueModel
logger
 
Fields inherited from interface org.springframework.binding.value.ValueModel
VALUE_PROPERTY
 
Constructor Summary
DeepCopyBufferedCollectionValueModel(ValueModel wrappedModel, Class wrappedType)
          Constructs a new DeepCopyBufferedCollectionValueModel.
 
Method Summary
protected  Object deepCopy(Object value)
          Create a new object that is a deep copy of the given object.
protected  Collection prepareBackingCollection(Collection col)
          Prepare the backing collection for installation into the listListModel.
 
Methods inherited from class org.springframework.binding.value.support.BufferedCollectionValueModel
createBufferedListModel, fireListModelChanged, getConcreteCollectionType, getValueToCommit, hasValueChanged, setValue
 
Methods inherited from class org.springframework.binding.value.support.BufferedValueModel
commit, getCommitTrigger, getInnerMostWrappedValueModel, getValue, getWrappedValueModel, isBuffering, onWrappedValueChanged, revert, setCommitTrigger, toString
 
Methods inherited from class org.springframework.binding.value.support.AbstractValueModel
addValueChangeListener, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChangeEvent, fireValueChangeWhenStillEqual, getValueChangeDetector, removeValueChangeListener, setValueChangeDetector, setValueSilently
 
Methods inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeepCopyBufferedCollectionValueModel

public DeepCopyBufferedCollectionValueModel(ValueModel wrappedModel,
                                            Class wrappedType)
Constructs a new DeepCopyBufferedCollectionValueModel.

Parameters:
wrappedModel - the value model to wrap
wrappedType - the class of the value contained by wrappedModel; this must be assignable to java.util.Collection or Object[].
Method Detail

prepareBackingCollection

protected Collection prepareBackingCollection(Collection col)
Prepare the backing collection for installation into the listListModel. Create a new collection that contains a deep copy of the elements in the given collection.

Overrides:
prepareBackingCollection in class BufferedCollectionValueModel
Parameters:
col - The collection of objects to process
Returns:
processed collection

deepCopy

protected Object deepCopy(Object value)
Create a new object that is a deep copy of the given object. This copy is created using serialization, so the object to be copied must implement Serializable. If it does not, then the original object will be returned. Any other error results in null being returned.

Parameters:
value -
Returns:
deep copy


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.