org.spicefactory.pimento.property
Class AbstractUnindexedCollectionHandler
java.lang.Object
org.spicefactory.pimento.property.AbstractAssociationHandler
org.spicefactory.pimento.property.AbstractCollectionHandler
org.spicefactory.pimento.property.AbstractUnindexedCollectionHandler
- All Implemented Interfaces:
- PropertyHandler
- Direct Known Subclasses:
- BagHandler, MapHandler, SetHandler
public abstract class AbstractUnindexedCollectionHandler
- extends AbstractCollectionHandler
Base class for property handlers that manage unindexed collections.
- Author:
- Jens Halm
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractUnindexedCollectionHandler
public AbstractUnindexedCollectionHandler()
prepareValueFromSnapshot
public Object prepareValueFromSnapshot(Object entity,
Object value,
SnapshotDecoder decoder,
EntityState state)
- Description copied from interface:
PropertyHandler
- Prepares the specified property value, performing all necessary conversions, but without actually
applying it to the specified entity. The prepared values will be collected in a
PropertyChangeSet
instance which gets passed to any configured interceptors before the property is applied with
the setValue method of this class.
- Parameters:
entity - the entity to prepare the property forvalue - the new value for the propertydecoder - the decoder to use for decoding associationsstate - the state of the entity
- Returns:
- the (possibly converted) value of the property as it will later be applied to the entity.
createCollectionUpdate
protected CollectionUpdate createCollectionUpdate(CollectionChangeSet changeSet,
SnapshotDecoder decoder)
- Creates a CollectionUpdate instance from the specified change set.
CollectionUpdate instances get passed to the configured interceptors before the change set
is applied with
applyCollectionUpdate. While the specified change set contains
entity snapshots the returned CollectionUpdate must contain the corresponding persistent entities.
- Parameters:
changeSet - the change set to convertdecoder - the decoder to use for the snapshots in the change set
- Returns:
- a CollectionUpdate instance created from the specified change set
setValue
public void setValue(Object entity,
Object value)
- Description copied from interface:
PropertyHandler
- Sets the specified property value of the given entity.
This method can safely assume that the value has been property prepared (possibly converted)
with the
prepareValueFromSnapshot method of this class before this method
gets invoked.
- Specified by:
setValue in interface PropertyHandler- Overrides:
setValue in class AbstractAssociationHandler
- Parameters:
entity - the entity to set the property forvalue - the new value for the property
applyCollectionUpdate
protected void applyCollectionUpdate(Object entity,
CollectionUpdate update,
Property property)
- Applies the specified collection update to the property of the given entity.
- Parameters:
entity - the entity the update should be applied toupdate - the collection update to applyproperty - the property of the entity that the update should be applied to