Top Description Fields Constructors Methods
org.eclipse.persistence.descriptors.changetracking

public Class CollectionChangeEvent

extends PropertyChangeEvent
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.descriptors.changetracking.MapChangeEvent
Imports
java.beans.PropertyChangeEvent

Purpose: 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

Field Summary

Modifier and TypeField and Description
public static final int
protected int
changeType

INTERNAL: Change type is either add or remove

protected Integer
index

INTERNAL: index is the location of the change in the collection

protected boolean
isChangeApplied

INTERNAL: This flag will indicate if the object has already been removed or added to the collection before raising an event.

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.

public static final int

Constructor Summary

AccessConstructor and Description
public
CollectionChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, 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.

public
CollectionChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, 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

Modifier and TypeMethod and Description
public int
getChangeType()

INTERNAL: Return the change type

public Integer
getIndex()

INTERNAL: Return the index of the change in the collection

public boolean
isChangeApplied()

INTERNAL: Return the value indicating if the object has been already added or removed from the collection.

public boolean
isSet()

INTERNAL: Return whether the event was raised by set operation on the list.

public void
setIndex(Integer index)

INTERNAL: Set the index of the change in the collection

Inherited from java.beans.PropertyChangeEvent:
getNewValuegetOldValuegetPropagationIdgetPropertyNamesetPropagationIdtoString

Field Detail

ADDback to summary
public static final int ADD
changeTypeback to summary
protected int changeType

INTERNAL: Change type is either add or remove

indexback to summary
protected Integer index

INTERNAL: index is the location of the change in the collection

isChangeAppliedback to summary
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.

isSetback to summary
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.

REMOVEback to summary
public static final int REMOVE

Constructor Detail

CollectionChangeEventback to summary
public CollectionChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, 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.

CollectionChangeEventback to summary
public CollectionChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, 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

getChangeTypeback to summary
public int getChangeType()

INTERNAL: Return the change type

getIndexback to summary
public Integer getIndex()

INTERNAL: Return the index of the change in the collection

isChangeAppliedback to summary
public boolean isChangeApplied()

INTERNAL: Return the value indicating if the object has been already added or removed from the collection.

isSetback to summary
public boolean isSet()

INTERNAL: Return whether the event was raised by set operation on the list.

setIndexback to summary
public void setIndex(Integer index)

INTERNAL: Set the index of the change in the collection