APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.beans.property

public abstract Class NullCoalescingPropertyBase<T>

extends ObjectPropertyBase<T>
Class Inheritance
Known Direct Subclasses
com.sun.javafx.scene.SceneContext.MediaProperty
Type Parameters
<T>
the value type
Imports
javafx.beans.property.ObjectPropertyBase, javafx.beans.value.ChangeListener, .ObservableValue, .WeakChangeListener, java.util.Objects

Base class for null-coalescing properties that evaluate to their local value if non-null, or to their base value if the local value is null.

Field Summary

Modifier and TypeField and Description
private final ObservableValue<T>
private T
private boolean
private final ChangeListener<T>
private final WeakChangeListener<T>

Constructor Summary

AccessConstructor and Description
protected
NullCoalescingPropertyBase(ObservableValue<T>
the base observable
baseObservable
)

Initializes a new NullCoalescingPropertyBase with the specified base value.

Method Summary

Modifier and TypeMethod and Description
public final void
connect()

Connects this property to the base observable and starts observing.

public final void
disconnect()

Disconnects this property from the base observable and stops observing.

protected final void
public final T
protected final void
invalidated()

Overrides javafx.beans.property.ObjectPropertyBase.invalidated.

The method invalidated() can be overridden to receive invalidation notifications.

protected void
onInvalidated()

Called when the current value has changed.

Inherited from javafx.beans.property.ObjectPropertyBase:
addListeneraddListenerbindisBoundremoveListenerremoveListenersettoStringunbind

Field Detail

baseObservableback to summary
private final ObservableValue<T> baseObservable
currentValueback to summary
private T currentValue
currentValueChangedback to summary
private boolean currentValueChanged
listenerback to summary
private final ChangeListener<T> listener

Hides javafx.beans.property.ObjectPropertyBase.listener.

weakListenerback to summary
private final WeakChangeListener<T> weakListener

Constructor Detail

NullCoalescingPropertyBaseback to summary
protected NullCoalescingPropertyBase(ObservableValue<T> baseObservable)

Initializes a new NullCoalescingPropertyBase with the specified base value.

Parameters
baseObservable:ObservableValue<T>

the base observable

Exceptions
NullPointerException:
if baseObservable is null

Method Detail

connectback to summary
public final void connect()

Connects this property to the base observable and starts observing.

disconnectback to summary
public final void disconnect()

Disconnects this property from the base observable and stops observing.

fireValueChangedEventback to summary
protected final void fireValueChangedEvent()

Overrides javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent.

Doc from javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent.

Sends notifications to all attached InvalidationListeners and ChangeListeners. This method is called when the value is changed, either manually by calling set or in case of a bound property, if the binding becomes invalid.

Annotations
@Override
getback to summary
public final T get()

Overrides javafx.beans.property.ObjectPropertyBase.get.

Implements javafx.beans.value.WritableObjectValue.get, javafx.beans.value.ObservableObjectValue.get.

Doc from javafx.beans.property.ObjectPropertyBase.get.

Get the wrapped value. This must be identical to the value returned from getValue().

This method exists only to align WritableObjectValue API with WritableBooleanValue and subclasses of WritableNumberValue

Annotations
@Override
invalidatedback to summary
protected final void invalidated()

Overrides javafx.beans.property.ObjectPropertyBase.invalidated.

Doc from javafx.beans.property.ObjectPropertyBase.invalidated.

The method invalidated() can be overridden to receive invalidation notifications. This is the preferred option in Objects defining the property, because it requires less memory. The default implementation is empty.

Annotations
@Override
onInvalidatedback to summary
protected void onInvalidated()

Called when the current value has changed.