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
All Methods Instance Methods Concrete Methods 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 Detail
-
PropertyChangeEvent
public PropertyChangeEvent(Object source, String propertyName, Object oldValue, Object newValue)
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 Detail
-
getPropertyName
public String 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
public void setPropagationId(Object propagationId)
Sets the propagationId object.- See Also:
getPropagationId()
-
getPropagationId
public Object 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
public 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
public Object 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.
-
-