|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.favabeans.base.MetadataProperty
A MetadataProperty
is a read-only
Property
implementation which obtains its value from
the FavaBeans type metadata registry, FavaBeans.TYPE_METADATA
.
Constructor Summary | |
MetadataProperty(Object target,
String key,
Class valueClass)
Create a new MetadataProperty for an object. |
Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener l)
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener l)
|
String |
getKey()
|
String |
getName()
Obtain the programmatic name of this property. |
Object |
getTarget()
Obtain the target of this Feature . |
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MetadataProperty(Object target, String key, Class valueClass)
MetadataProperty
for an object.target
- the object for which this
MetadataProperty
is to be created.key
- the metadata registry key for looking up the values
of this property. See TypeMetadataRegistry.getForObject(Object,String)
.valueClass
- the most general Java class of the values of
this property. See Property.getValueClass()
.Method Detail |
public String getKey()
public String getName()
Property
getName
in interface Property
org.favabeans.base.Property
public Object getTarget()
Feature
Feature
.getTarget
in interface Feature
org.favabeans.base.Feature
public Class getValueClass()
Property
Property
. As a minimum, this
operation should return Object
.getValueClass
in interface Property
org.favabeans.base.Property
public boolean isEnabled()
Property
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").isEnabled
in interface Property
org.favabeans.base.Property
true
if this Property
is
enabled; false
if it is disabled.public PropertyEditor newEditor()
Property
PropertyEditor
instance suitable for
editing the value of ths Property object, as in a
"property sheet" view.newEditor
in interface Property
org.favabeans.base.Property
PropertyEditor
.public Object getValue()
Property
Property
.getValue
in interface Property
org.favabeans.base.Property
Property
.public boolean isValueSettable()
Property
Property
can
be set. If this method returns false
, calls to
setValue
will return silently with no effect.isValueSettable
in interface Property
org.favabeans.base.Property
true
if the value can be set;
false
otherwise.public boolean isValueSettable(Object value)
Property
Property.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 Property.setValue(Object)
if necessary.
isValueSettable
in interface Property
org.favabeans.base.Property
value
- the candidate property value.false
if the candidate value is known to
be unacceptable; true
otherwise.public void setValue(Object value) throws PropertyValueException
Property
Property
.setValue
in interface Property
org.favabeans.base.Property
value
- the desired new value of the Property
.PropertyValueException
- if there was a problem
setting the value, or if the value was not acceptable.public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener
in interface Property
public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
in interface Property
public void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
addPropertyChangeListener
in interface Property
public void removePropertyChangeListener(String propertyName, PropertyChangeListener l)
removePropertyChangeListener
in interface Property
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |