Class CollectionChangeEvent
- java.lang.Object
-
- java.util.EventObject
-
- java.beans.PropertyChangeEvent
-
- org.eclipse.persistence.descriptors.changetracking.CollectionChangeEvent
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
MapChangeEvent
public class CollectionChangeEvent extends java.beans.PropertyChangeEventPurpose: Define a change event for collection types.
Description: For any object that wishes to use either object change tracking or attribute change tracking, its collection attributes need to fire CollectionChangeEvent in the add or remove methods.
Responsibilities: Create a CollectionChangeEvent for an object
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intADDprotected intchangeTypeINTERNAL: Change type is either add or removeprotected java.lang.IntegerindexINTERNAL: index is the location of the change in the collectionprotected booleanisChangeAppliedINTERNAL: This flag will indicate if the object has already been removed or added to the collection before raising an event.protected booleanisSetINTERNAL: Set operation in IndirectList results in raising two events: removal of the old value and addition of the new one at the same index: oldValue = list.set(i, newValue); raiseRemoveEvent(i, oldValue, true); raiseAddEvent(i, newValue, true); This flag indicates whether the event was raised by set operation on the list.static intREMOVE
-
Constructor Summary
Constructors Constructor Description CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType)Deprecated.as of EclipseLink 2.3CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, boolean isChangeApplied)PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value, change type (add or remove) and change applied.CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index)Deprecated.as of EclipseLink 2.3CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isSet)Deprecated.as of EclipseLink 2.3CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isSet, boolean isChangeApplied)PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value, change type (add or remove) and the index where the object is/was in the collection (list), flag indicating whether the change (addition or removal) is part of a single set operation on a list, flag indicating whether the object has already been added or removed from the collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetChangeType()INTERNAL: Return the change typejava.lang.IntegergetIndex()INTERNAL: Return the index of the change in the collectionbooleanisChangeApplied()INTERNAL: Return the value indicating if the object has been already added or removed from the collection.booleanisSet()INTERNAL: Return whether the event was raised by set operation on the list.voidsetIndex(java.lang.Integer index)INTERNAL: Set the index of the change in the collection
-
-
-
Field Detail
-
ADD
public static final int ADD
- See Also:
- Constant Field Values
-
REMOVE
public static final int REMOVE
- See Also:
- Constant Field Values
-
changeType
protected int changeType
INTERNAL: Change type is either add or remove
-
index
protected java.lang.Integer index
INTERNAL: index is the location of the change in the collection
-
isSet
protected boolean isSet
INTERNAL: Set operation in IndirectList results in raising two events: removal of the old value and addition of the new one at the same index: oldValue = list.set(i, newValue); raiseRemoveEvent(i, oldValue, true); raiseAddEvent(i, newValue, true); This flag indicates whether the event was raised by set operation on the list.
-
isChangeApplied
protected boolean isChangeApplied
INTERNAL: This flag will indicate if the object has already been removed or added to the collection before raising an event. The object is not removed or added before raising an event during merge.
-
-
Constructor Detail
-
CollectionChangeEvent
public CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType)Deprecated.as of EclipseLink 2.3PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value and change type (add or remove)
-
CollectionChangeEvent
public CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, boolean isChangeApplied)PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value, change type (add or remove) and change applied.
-
CollectionChangeEvent
public CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index)Deprecated.as of EclipseLink 2.3PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value, change type (add or remove) and the index where the object is/was in the collection (list)
-
CollectionChangeEvent
public CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isSet)Deprecated.as of EclipseLink 2.3PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value, change type (add or remove) and the index where the object is/was in the collection (list), flag indicating whether the change (addition or removal) is part of a single set operation on a list.
-
CollectionChangeEvent
public CollectionChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isSet, boolean isChangeApplied)PUBLIC: Create a CollectionChangeEvent for an object based on the property name, old value, new value, change type (add or remove) and the index where the object is/was in the collection (list), flag indicating whether the change (addition or removal) is part of a single set operation on a list, flag indicating whether the object has already been added or removed from the collection.
-
-
Method Detail
-
getChangeType
public int getChangeType()
INTERNAL: Return the change type
-
isSet
public boolean isSet()
INTERNAL: Return whether the event was raised by set operation on the list.
-
getIndex
public java.lang.Integer getIndex()
INTERNAL: Return the index of the change in the collection
-
setIndex
public void setIndex(java.lang.Integer index)
INTERNAL: Set the index of the change in the collection
-
isChangeApplied
public boolean isChangeApplied()
INTERNAL: Return the value indicating if the object has been already added or removed from the collection.
-
-