public class Nestings extends Object
This class provides static functions to obtain builders for nested classes like Nesting
or
NestedProperty
.
on
will return a builder whose type depends on the type of the specified
observable. Similarly a call to one of the builders' nest...
-methods returns a (new) builder whose type
depends on the type of observable the nesting step will return. Each type of builder allows only those functions
which are supported by that observable.
DoubleProperty
, a DoublePropertyNestingBuilder
will be returned. Because a Double
cannot contain
another observable no further nesting is possible and hence no nest...
-methods are available. But it can be
used to build a NestedDoubleProperty
which in turn is not possible e.g. on an ObservableValue
and is
hence not provided by an ObservableValueNestingBuilder
.
Likewise a ChangeListener
cannot be added if the last step provides an Observable
because it only
accepts InvalidationListeners
.
Nestings.on(currentEmployee)
.nestProperty(employee -> employee.addressProperty())
.nestProperty(address -> address.streetNameProperty())
.addListener((observable, oldValue, newValue) -> ... );
NestedStringProperty asNestedStringProperty = Nestings.on(currentEmployee)
.nestProperty(employee -> employee.addressProperty())
.nestStringProperty(address -> address.streetNameProperty())
.buildProperty();
Constructor and Description |
---|
Nestings() |
Modifier and Type | Method and Description |
---|---|
static ObservableNestingBuilder |
on(javafx.beans.Observable outerObservable)
Starts a nesting with the specified outer observable.
|
static <T> ObservableValueNestingBuilder<T> |
on(javafx.beans.value.ObservableValue<T> outerObservable)
Starts a nesting with the specified outer observable.
|
static <T> ObjectPropertyNestingBuilder<T> |
on(javafx.beans.property.Property<T> outerProperty)
Starts a nesting with the specified outer property.
|
public static ObservableNestingBuilder on(javafx.beans.Observable outerObservable)
outerObservable
- the outer Observable
on which the nesting beginsObservableNestingBuilder
which depends on the specified outer observablepublic static <T> ObservableValueNestingBuilder<T> on(javafx.beans.value.ObservableValue<T> outerObservable)
T
- the type the outer observable wrapsouterObservable
- the outer ObservableValue
on which the nesting beginsObservableValueNestingBuilder
which depends on the specified outer observablepublic static <T> ObjectPropertyNestingBuilder<T> on(javafx.beans.property.Property<T> outerProperty)
T
- the type the outer property wrapsouterProperty
- the outer Property
on which the nesting beginsObjectPropertyNestingBuilder
which depends on the specified outer observable valueThis documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.