public abstract class AbstractProperty extends java.lang.Object implements Property
Modifier | Constructor and Description |
---|---|
protected |
AbstractProperty(java.lang.Object sourceBean,
java.lang.String name)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.
|
abstract void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener.
|
void |
clearValue()
This clears the current and previous value without notifying listeners
|
java.lang.String |
getName()
Gets the name of the property.
|
java.lang.Object |
getSourceBean()
Gets the source bean of the property.
|
java.lang.Object |
getValue()
Gets the property value.
|
boolean |
isReporting()
Indicates if the property is reporting changes.
|
abstract boolean |
isVetoable()
Indicates if changes to this property can be vetoed.
|
void |
notifyListeners()
Reports changes to the Property.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener.
|
abstract void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a VetoableChangeListener.
|
protected void |
setCurrentValue(java.lang.Object newValue)
Sets the current value.
|
void |
setReporting(boolean reportChanges)
Enables or disables the reporting of property changes.
|
abstract void |
setValue(java.lang.Object newValue)
Sets the property value.
|
abstract void |
setValueAndNotifyListeners(java.lang.Object newValue)
Sets the property value.
|
protected AbstractProperty(java.lang.Object sourceBean, java.lang.String name)
sourceBean
- The source bean of the property.name
- The name of the property.public final java.lang.Object getSourceBean()
getSourceBean
in interface Property
public final java.lang.String getName()
public java.lang.Object getValue()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface Property
listener
- The PropertyChangeListener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Property
listener
- The PropertyChangeListener to remove.public abstract void addVetoableChangeListener(java.beans.VetoableChangeListener listener) throws java.lang.UnsupportedOperationException
addVetoableChangeListener
in interface Property
listener
- The VetoableChangeListener to add.java.lang.UnsupportedOperationException
- This operation is unsupported for this
type of Property.public abstract void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
removeVetoableChangeListener
in interface Property
listener
- The VetoableChangeListener to remove.public abstract boolean isVetoable()
isVetoable
in interface Property
public abstract void setValueAndNotifyListeners(java.lang.Object newValue) throws java.beans.PropertyVetoException
isReporting()
is true. Will always notify any, registered,
VetoableChangeListener-s.setValueAndNotifyListeners
in interface Property
newValue
- The new property value.java.beans.PropertyVetoException
- A registered VetoableChangeListener objected
to the change. The change was not committed.public abstract void setValue(java.lang.Object newValue) throws java.beans.PropertyVetoException
protected final void setCurrentValue(java.lang.Object newValue)
newValue
- The new property value.public final void setReporting(boolean reportChanges)
setReporting
in interface Property
reportChanges
- Whether to enable or disable property change
reporting.public final boolean isReporting()
isReporting
in interface Property
public final void notifyListeners()
isReporting()
is true and the current value of the property
is not equal to the previously-reported value.notifyListeners
in interface Property
public void clearValue()
clearValue
in interface Property