|
6 | 6 |
|
7 | 7 | /** |
8 | 8 | * <p> |
9 | | - * A {@link Property} which is based on a {@link Nesting}. Simply put, this property is always bound to the nesting's |
10 | | - * inner observable (more precisely, it is bound to the {@link Property} instance contained in the optional value held |
11 | | - * by the nesting's {@link Nesting#innerObservableProperty() innerObservable} property). |
12 | | - * <h2>Inner Observable's Value Changes</h2> This property is bound to the nesting's inner observable. So when that |
13 | | - * observable's value changes, so does this property. |
| 9 | + * A {@link Property} which is based on a {@link Nesting}. |
| 10 | + * <p> |
| 11 | + * Simply put, this property is always bound to the nesting's inner observable (more precisely, it is bound to the |
| 12 | + * {@link Property} instance contained in the optional value held by the nesting's |
| 13 | + * {@link Nesting#innerObservableProperty() innerObservable} property). |
| 14 | + * <h2>Value Changes</h2> This property is bidirectionally bound to the nesting's inner observable. So when that |
| 15 | + * observable's value changes, so does this property's value and vice versa. |
14 | 16 | * <h2>Inner Observable Is Replaced</h2> When the nesting's inner observable is replaced by a present observable, this |
15 | 17 | * nested property's value changes to the new observable's value. Like all other value changes this one also results in |
16 | 18 | * calling invalidation and change listeners. |
17 | | - * <p> |
18 | | - * If the new observable is missing, this property stays unbound and keeps its value (and hence no listener is called). |
19 | | - * <h2>Inner Observable is Missing</h2> It is possible that a nesting's inner observable is missing (see comment on |
| 19 | + * <h2>Missing Inner Observable</h2> It is possible that a nesting's inner observable is missing (see comment on |
20 | 20 | * {@link Nesting}). In that case the {@link NestedProperty#innerObservablePresentProperty() innerObservablePresent} |
21 | | - * property is false and changes made to this property's value can not be propagated to another property. |
22 | | - * <p> |
23 | | - * If the inner observable changes back to a present value, everything said above applies. This implies that when the |
24 | | - * nested property's value changed while the inner observable was missing, these changes are replaced by the new |
25 | | - * observable's value when one is set. Since this property's change listeners are called, the replaced value can be |
26 | | - * caught there before it gets lost. TODO add comments explaining what happens when inner observable goes missing |
| 21 | + * property is false. How else the nested property behaves depends on its configuration which was determined when it was |
| 22 | + * build. |
| 23 | + * <h3>When Inner Observable Goes Missing</h3> When the inner observable goes missing, the nested property will either |
| 24 | + * keep its value (this is the default behavior) or change to a value which was determined at build time. This can be |
| 25 | + * done with the {@code onInnerObservableMissing...} methods on the nested property builder (e.g. |
| 26 | + * {@link NestedObjectPropertyBuilder#onInnerObservableMissingSetDefaultValue() onInnerObservableMissingSetDefaultValue} |
| 27 | + * ). |
| 28 | + * <h3>Update While Inner Observable Is Missing</h3> When a value is set on the nested property while the inner |
| 29 | + * observable is missing, it can not be propagated anywhere. For this reason the default behavior is to throw an |
| 30 | + * exception. Alternatively the property can hold new values until a new inner observable is found (with |
| 31 | + * {@link NestedObjectPropertyBuilder#onUpdateWhenInnerObservableMissingAcceptValues() |
| 32 | + * onUpdateWhenInnerObservableMissingAcceptValues}). The property will then be bound to the new observable and hence |
| 33 | + * forget the intermediate value. (Since this property's change listeners are called, the replaced value can be caught |
| 34 | + * there before it gets lost.) |
27 | 35 | * |
28 | 36 | * @param <T> |
29 | 37 | * the type of the value wrapped by the property |
|
0 commit comments