Package java.beans
Class PropertyChangeEvent
java.lang.Object
java.util.EventObject
java.beans.PropertyChangeEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
IndexedPropertyChangeEvent
public class PropertyChangeEvent extends EventObject
An event that indicates that a constraint or a boundary of a property has
changed.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
Constructors Constructor Description PropertyChangeEvent(Object source, String propertyName, Object oldValue, Object newValue)The constructor used to create a newPropertyChangeEvent. -
Method Summary
Modifier and Type Method Description ObjectgetNewValue()Returns the new value that the property now has.ObjectgetOldValue()Returns the old value that the property had.ObjectgetPropagationId()Returns the propagationId object.StringgetPropertyName()Returns the name of the property that has changed.voidsetPropagationId(Object propagationId)Sets the propagationId object.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
PropertyChangeEvent
The constructor used to create a newPropertyChangeEvent.- Parameters:
source- the changed bean.propertyName- the changed property, ornullto indicate an unspecified set of the properties has changed.oldValue- the previous value of the property, ornullif thepropertyNameisnullor the previous value is unknown.newValue- the new value of the property, ornullif thepropertyNameisnullor the new value is unknown.
-
-
Method Details
-
getPropertyName
Returns the name of the property that has changed. If an unspecified set of properties has changed it returns null.- Returns:
- the name of the property that has changed, or null.
-
setPropagationId
Sets the propagationId object.- See Also:
getPropagationId()
-
getPropagationId
Returns the propagationId object. This is reserved for future use. Beans 1.0 demands that a listener receiving this property and then sending its own PropertyChangeEvent sets the received propagationId on the new PropertyChangeEvent's propagationId field.- Returns:
- the propagationId object.
-
getOldValue
Returns the old value that the property had. If the old value is unknown this method returns null.- Returns:
- the old property value or null.
-
getNewValue
Returns the new value that the property now has. If the new value is unknown this method returns null.- Returns:
- the old property value or null.
-