|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.binding.beans.PropertyAccessor
public final class PropertyAccessor
An unmodifiable Object that describes and provides access to a bean property.
Constructor Summary | |
---|---|
PropertyAccessor(String propertyName,
Method readMethod,
Method writeMethod)
Constructs a PropertyAcessor for the given property name, reader and writer. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getPropertyName()
|
Class<?> |
getPropertyType()
|
Method |
getReadMethod()
|
Object |
getValue(Object bean)
Invokes this accessor's reader on the given bean. |
Method |
getWriteMethod()
|
int |
hashCode()
|
boolean |
isReadOnly()
|
boolean |
isWriteOnly()
|
void |
setValue(Object bean,
Object newValue)
Invokes this accessor's writer on the given bean with the given value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyAccessor(String propertyName, Method readMethod, Method writeMethod)
propertyName
- the name of the property, e.g. "name", "enabled"readMethod
- the method that returns the property value,
e.g. getName()
, isEnabled()
writeMethod
- the method that sets the property value,
e.g. setName(String)
, setEnabled(boolean)
NullPointerException
- if propertyName
is nullMethod Detail |
---|
public String getPropertyName()
public Class<?> getPropertyType()
public Method getReadMethod()
null
, if not availablepublic Method getWriteMethod()
null
, if not availablepublic boolean isReadOnly()
true
if the property cannot be written,
false
if it can be writtenpublic boolean isWriteOnly()
true
if the property cannot be read,
false
if it can be readpublic Object getValue(Object bean)
bean
- the target bean where the reader is to be invoked
NullPointerException
- if bean
is null
UnsupportedOperationException
- if the property is write-onlypublic void setValue(Object bean, Object newValue) throws PropertyVetoException
bean
- the target bean where the property value shall be setnewValue
- the value to set
NullPointerException
- if bean
is null
UnsupportedOperationException
- if the property is write-only
PropertyVetoException
- if the invoked writer throws such an exceptionpublic boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |