java.beans
Class PropertyChangeEvent
java.lang.Object
|
+--java.util.EventObject
|
+--java.beans.PropertyChangeEvent
PropertyChangeEvents are fired in the PropertyChange and VetoableChange
event classes. They represent the old and new values as well as the
source Bean. If the old or new value is a primitive type, it must be
wrapped in the appropriate wrapper type (java.lang.Integer for int, etc.,
etc.).
If the old or new values are unknown (although why that would be I do
not know), they may be null. Also, if the set of properties itself has
changed, the name should be null, and the old and new values may also be
null. Right now Sun put in a propagationId, reserved for future use. Read
the comments on the constructor and on setPropagationId for more
information.
Since:Authors:- John Keiser
- Eric Blake <ebb9@email.byu.edu>
PropertyChangeEvent
public PropertyChangeEvent(java.lang.Object source, java.lang.String propertyName, java.lang.Object oldVal, java.lang.Object newVal)
Create a new PropertyChangeEvent. Remember that if you received a
PropertyChangeEvent and are sending a new one, you should also set the
propagation ID from the old PropertyChangeEvent.
Parameters:
Throws:
getNewValue
public Object getNewValue()
Get the property's new value. May be null if multiple properties changed.
Returns:
getOldValue
public Object getOldValue()
Get the property's old value. May be null if multiple properties changed.
Returns:
getPropagationId
public Object getPropagationId()
Get the propagation ID. Right now, it is not used for anything.
Returns:
See Also:
getPropertyName
public String getPropertyName()
Get the property name. May be null if multiple properties changed.
Returns:
setPropagationId
public void setPropagationId(java.lang.Object propagationId)
Set the propagation ID. This is a way for the event to be passed from
hand to hand and retain a little extra state. Right now it is unused,
but it should be propagated anyway so that future versions of JavaBeans
can use it, for God knows what.
Parameters:
See Also:
If the old or new values are unknown (although why that would be I do not know), they may be null. Also, if the set of properties itself has changed, the name should be null, and the old and new values may also be null. Right now Sun put in a propagationId, reserved for future use. Read the comments on the constructor and on setPropagationId for more information.