V
- is the generic type of the value
.public abstract class AbstractProperty<V> extends Object implements WritableProperty<V>, Cloneable
WritableProperty
.Modifier and Type | Class and Description |
---|---|
class |
AbstractProperty.PropertyBuilder<T extends AbstractProperty<? extends V>>
|
Modifier and Type | Field and Description |
---|---|
private Bean |
bean |
private String |
name |
private AbstractValidator<? super V> |
validator |
NO_PROPERTIES
PROPERTY_TYPE
Constructor and Description |
---|
AbstractProperty(String name,
Bean bean)
The constructor.
|
AbstractProperty(String name,
Bean bean,
AbstractValidator<? super V> validator)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assignValueFrom(javafx.beans.value.ObservableValue<? extends V> observableValue)
|
protected AbstractProperty<V> |
clone() |
protected AbstractProperty<V> |
copy() |
AbstractProperty<V> |
copy(AbstractValidator<? super V> newValidator)
Creates a new empty instance of this property with the given new parameters.
|
AbstractProperty<V> |
copy(Bean newBean)
Creates a new empty instance of this property with the given new parameters.
|
AbstractProperty<V> |
copy(Bean newBean,
AbstractValidator<? super V> newValidator)
Creates a new empty instance of this property with the given new parameters.
|
AbstractProperty<V> |
copy(String newName,
Bean newBean)
Creates a new empty instance of this property with the given new parameters.
|
AbstractProperty<V> |
copy(String newName,
Bean newBean,
AbstractValidator<? super V> newValidator)
Creates a new empty instance of this property with the given new parameters.
|
boolean |
equals(Object obj) |
protected abstract void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListener s and
ChangeListener s. |
Bean |
getBean() |
protected JsonUtil |
getJsonUtil() |
String |
getName() |
AbstractValidator<? super V> |
getValidator() |
int |
hashCode() |
boolean |
isMandatory() |
void |
toJson(javax.json.stream.JsonGenerator json)
Serializes this object as JSON (JavaScript-Object-Notation).
|
protected abstract void |
toJson(javax.json.stream.JsonGenerator json,
V value) |
String |
toString() |
abstract ObjectValidatorBuilder<? extends V,? extends AbstractProperty.PropertyBuilder<? extends AbstractProperty<? extends V>>,?> |
withValdidator() |
protected <PROPERTY extends AbstractProperty<? extends V>,BUILDER extends ObjectValidatorBuilder<? extends V,AbstractProperty.PropertyBuilder<PROPERTY>,?>> |
withValdidator(Function<AbstractProperty.PropertyBuilder<PROPERTY>,BUILDER> factory) |
finalize, getClass, notify, notifyAll, wait, wait, wait
getReadOnly, getReadOnly, isReadOnly, isValid, validate
bind, bindBidirectional, isBound, unbind, unbindBidirectional
setValue
getType
addListener, getValue, removeListener
getValue
fromJson
private String name
private Bean bean
private AbstractValidator<? super V> validator
public AbstractProperty(String name, Bean bean, AbstractValidator<? super V> validator)
name
- - see getName()
.bean
- - see getBean()
.validator
- - see WritableProperty.validate()
.public String getName()
getName
in interface javafx.beans.property.ReadOnlyProperty<V>
getName
in interface AttributeReadName
getName
in interface PropertyPath<V>
getName
in interface ReadableProperty<V>
capital
letter followed by alpha-numeric characters. The name of a single property must especially not contain the
dot character (.) that is used to separate segments in a path
.public Bean getBean()
getBean
in interface javafx.beans.property.ReadOnlyProperty<V>
getBean
in interface ReadableProperty<V>
protected AbstractProperty<V> clone()
protected AbstractProperty<V> copy()
public final AbstractProperty<V> copy(Bean newBean)
newBean
- the new bean
.public final AbstractProperty<V> copy(AbstractValidator<? super V> newValidator)
newValidator
- the new validator
.public final AbstractProperty<V> copy(Bean newBean, AbstractValidator<? super V> newValidator)
public final AbstractProperty<V> copy(String newName, Bean newBean)
public final AbstractProperty<V> copy(String newName, Bean newBean, AbstractValidator<? super V> newValidator)
protected void assignValueFrom(javafx.beans.value.ObservableValue<? extends V> observableValue)
value
from the ObservableValue
(typically a WritableProperty
) to
this property. Can be overridden to avoid boxing overhead.observableValue
- the property to assign the value from.protected abstract void fireValueChangedEvent()
InvalidationListener
s and
ChangeListener
s.
This method is called when the value is changed, either manually by calling WritableValue.setValue(Object)
or in case of
a bound property, if the binding becomes invalid.public final AbstractValidator<? super V> getValidator()
AbstractValidator
.public final boolean isMandatory()
isMandatory
in interface WritableProperty<V>
true
if this property is mandatory (a value
of null
is NOT
valid
.protected <PROPERTY extends AbstractProperty<? extends V>,BUILDER extends ObjectValidatorBuilder<? extends V,AbstractProperty.PropertyBuilder<PROPERTY>,?>> BUILDER withValdidator(Function<AbstractProperty.PropertyBuilder<PROPERTY>,BUILDER> factory)
PROPERTY
- the generic type of the AbstractProperty
.BUILDER
- the generic type of the ObjectValidatorBuilder
for <VALUE>.factory
- the Function
to use as factory for the builder.builder
for the validator of this property with a
parent-builder
to create a copy(AbstractValidator)
of this
property with the configured validator.public abstract ObjectValidatorBuilder<? extends V,? extends AbstractProperty.PropertyBuilder<? extends AbstractProperty<? extends V>>,?> withValdidator()
builder
for the validator of this property with a
parent-builder
to create a copy(AbstractValidator)
of this
property with the configured validator.public final void toJson(javax.json.stream.JsonGenerator json)
JsonSupport
toJson
in interface JsonSupport
json
- the JsonGenerator
where to write this object to. Has to be in
JsonGenerator.writeStartObject()
state.JsonUtil.write(JsonGenerator, String, Object)
protected abstract void toJson(javax.json.stream.JsonGenerator json, V value)
json
- the JsonGenerator
.value
- the value
.toJson(JsonGenerator)
Copyright © 2001–2016 mmm-Team. All rights reserved.