org.favabeans.base
Interface Property

All Superinterfaces:
Feature
All Known Implementing Classes:
BeanProperty, MetadataProperty

public interface Property
extends Feature

A Property is a proxy to a piece of information about a specific object.


Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
           
 String getName()
          Obtain the programmatic name of this property.
 Object getValue()
          Obtain the value of the Property.
 Class getValueClass()
          Determine the most general Java class of the objects which are values of this Property.
 boolean isEnabled()
          Determine whether this Property is enabled.
 boolean isValueSettable()
          Determine whether the value of this Property can be set.
 boolean isValueSettable(Object value)
          Check if the given value is an allowable argument to setValue(Object).
 PropertyEditor newEditor()
          Obtain a PropertyEditor instance suitable for editing the value of ths Property object, as in a "property sheet" view.
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener l)
           
 void setValue(Object value)
          Set the value of the Property.
 
Methods inherited from interface org.favabeans.base.Feature
getTarget
 

Method Detail

getName

public String getName()
Obtain the programmatic name of this property.
Returns:
the programmatic name of the property.

getValueClass

public Class getValueClass()
Determine the most general Java class of the objects which are values of this Property. As a minimum, this operation should return Object.
Returns:
the appropriate class.

isEnabled

public boolean isEnabled()
Determine whether this Property is enabled. a "disabled" property is one which should be displayed in UI elements, but in a state which indicates that it is non-functional and/or non-applicable (e.g., by "graying out").
Returns:
true if this Property is enabled; false if it is disabled.

newEditor

public PropertyEditor newEditor()
Obtain a PropertyEditor instance suitable for editing the value of ths Property object, as in a "property sheet" view.
Returns:
a suitable PropertyEditor.

getValue

public Object getValue()
Obtain the value of the Property.
Returns:
the value of the Property.

isValueSettable

public boolean isValueSettable()
Determine whether the value of this Property can be set. If this method returns false, calls to setValue will return silently with no effect.
Returns:
true if the value can be set; false otherwise.

isValueSettable

public boolean isValueSettable(Object value)
Check if the given value is an allowable argument to setValue(Object). This should be overridden to provide end-user feedback regarding the correctness of a property value, where such information is available to the implementation.

The default behavior of this method is to return true, and throw an exception in setValue(Object) if necessary.

Parameters:
value - the candidate property value.
Returns:
false if the candidate value is known to be unacceptable; true otherwise.

setValue

public void setValue(Object value)
              throws PropertyValueException
Set the value of the Property.
Parameters:
value - the desired new value of the Property.
Throws:
PropertyValueException - if there was a problem setting the value, or if the value was not acceptable.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener l)


Copyright © 2000-2001, Regents of the University of Minnesota. All Rights Reserved.