public final class PropertyReference<T> extends Object
Bean
.Constructor and Description |
---|
PropertyReference(Class<?> clazz,
String name)
Creates a new
PropertyReference for a property of a bean. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
T |
get(Object bean)
Get the value of the property.
|
Class<?> |
getContainingClass()
Returns the class of the
Bean that contains the property. |
String |
getName()
Returns the name of the property.
|
ReadOnlyProperty<T> |
getProperty(Object bean)
Get the
ObservableValue implementation of the
property. |
Class<?> |
getType()
Returns the type of the property.
|
int |
hashCode() |
boolean |
hasProperty()
Can be used to determine if a property provides an implementation of
ObservableValue . |
boolean |
isReadable()
Can be used to determine if a property can be get.
|
boolean |
isWritable()
Can be used to determine if a property can be set.
|
void |
set(Object bean,
T value)
Set the property to a new value.
|
String |
toString() |
public PropertyReference(Class<?> clazz, String name)
PropertyReference
for a property of a bean.clazz
- The class of the Bean
that contains the propertyname
- The name of the propertyNullPointerException
- if clazz
or name
are nullIllegalArgumentException
- if name
is an empty String
public boolean isWritable()
true
, if the property can be set, false
otherwisepublic boolean isReadable()
true
, if the property can be get, false
otherwisepublic boolean hasProperty()
ObservableValue
.public String getName()
public Class<?> getContainingClass()
Bean
that contains the property.Bean
public Class<?> getType()
public void set(Object bean, T value)
bean
- The Bean
instance for which the property should be setvalue
- The new valueIllegalStateException
- if the property is not writablepublic T get(Object bean)
bean
- The Bean
instance for which the property should be
readIllegalStateException
- if the property is not readablepublic ReadOnlyProperty<T> getProperty(Object bean)
ObservableValue
implementation of the
property.bean
- The Bean
instance for which the property should be
readObservableValue
of the propertyIllegalStateException
- if the property does not provide an implementationCopyright © 2020. All rights reserved.