V
- is the generic type of the value
.public class GenericProperty<V> extends AbstractRegularProperty<V>
WritableProperty
.AbstractProperty.PropertyBuilder<T extends AbstractProperty<? extends V>>
Modifier and Type | Field and Description |
---|---|
private GenericType<V> |
type |
static GenericType<Object> |
TYPE_DEFAULT
|
private V |
value |
NO_PROPERTIES
PROPERTY_TYPE
Constructor and Description |
---|
GenericProperty(String name,
GenericType<V> type,
Bean bean)
The constructor.
|
GenericProperty(String name,
GenericType<V> type,
Bean bean,
AbstractValidator<? super V> validator)
The constructor.
|
GenericProperty(String name,
GenericType<V> type,
Bean bean,
Supplier<? extends V> expression)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected V |
doGetValue() |
protected boolean |
doSetValue(V newValue)
Called from
AbstractValueProperty.setValue(Object) . |
void |
fromJson(javax.json.stream.JsonParser json)
Deserializes this object from JSON (JavaScript-Object-Notation).
|
GenericType<V> |
getType() |
protected void |
toJson(javax.json.stream.JsonGenerator json,
V propertyValue) |
ObjectValidatorBuilder<? extends V,? extends AbstractProperty.PropertyBuilder<? extends GenericProperty<? extends V>>,?> |
withValdidator() |
addListener, addListener, fireValueChangedEvent, removeListener, removeListener
bind, bindBidirectional, clearValidationResult, copy, equals, getReadOnly, getValue, hashCode, invalidated, isBound, isReadOnly, isValid, markInvalid, requireWritable, setValue, unbind, unbindBidirectional, validate
assignValueFrom, clone, copy, copy, copy, copy, copy, getBean, getJsonUtil, getName, getValidator, isMandatory, toJson, toString, withValdidator
finalize, getClass, notify, notifyAll, wait, wait, wait
getReadOnly
public static final GenericType<Object> TYPE_DEFAULT
private final GenericType<V> type
private V value
public GenericProperty(String name, GenericType<V> type, Bean bean)
name
- - see AbstractProperty.getName()
.type
- - see getType()
.bean
- - see AbstractProperty.getBean()
.public GenericProperty(String name, GenericType<V> type, Bean bean, AbstractValidator<? super V> validator)
name
- - see AbstractProperty.getName()
.type
- - see getType()
.bean
- - see AbstractProperty.getBean()
.validator
- - see AbstractValueProperty.validate()
.public GenericProperty(String name, GenericType<V> type, Bean bean, Supplier<? extends V> expression)
name
- - see AbstractProperty.getName()
.type
- - see getType()
.bean
- - see AbstractProperty.getBean()
.expression
- the Supplier
providing
the actual value
.public GenericType<V> getType()
value
. Please note that the generic signature of this method
is returning the type GenericType
<? extends V> instead of GenericType
<V> because JavaFx is binding the type Number
for all numeric properties while e.g.
IntegerProperty
should be able to return GenericType
<Integer> what is compatible
with GenericType
<? extends Number>.protected V doGetValue()
doGetValue
in class AbstractValueProperty<V>
value
.protected boolean doSetValue(V newValue)
AbstractValueProperty
AbstractValueProperty.setValue(Object)
.doSetValue
in class AbstractValueProperty<V>
newValue
- the new value
to set.true
if the value
has changed, false
otherwise.public ObjectValidatorBuilder<? extends V,? extends AbstractProperty.PropertyBuilder<? extends GenericProperty<? extends V>>,?> withValdidator()
withValdidator
in class AbstractProperty<V>
builder
for the validator of this property with a
parent-builder
to create a AbstractProperty.copy(AbstractValidator)
of this
property with the configured validator.protected void toJson(javax.json.stream.JsonGenerator json, V propertyValue)
toJson
in class AbstractProperty<V>
json
- the JsonGenerator
.propertyValue
- the value
.AbstractProperty.toJson(JsonGenerator)
public void fromJson(javax.json.stream.JsonParser json)
JsonSupport
JsonSupport.toJson(JsonGenerator)
- e.g. JsonSupport.toJson(JsonGenerator)
might write a property with its value while
JsonSupport.fromJson(JsonParser)
may only deserialze the value as the parent object has to handle the property names
that may appear in any order.json
- the JsonParser
to read from.Copyright © 2001–2016 mmm-Team. All rights reserved.