48 * All methods to change properties return a reference to this builder, to enable
49 * method chaining.
50 * <p>
51 * If you have to generate adapters for the same property of several instances
52 * of the same class, you can reuse a {@code ReadOnlyJavaBeanObjectPropertyBuilder}.
53 * by switching the Java Bean instance (with {@link #bean(java.lang.Object)} and
54 * calling {@link #build()}.
55 *
56 * @see ReadOnlyJavaBeanObjectProperty
57 *
58 * @param T the type of the wrapped {@code Object}
59 * @since JavaFX 2.1
60 */
61 public final class ReadOnlyJavaBeanObjectPropertyBuilder<T> {
62
63 private final ReadOnlyJavaBeanPropertyBuilderHelper helper = new ReadOnlyJavaBeanPropertyBuilderHelper();
64
65 /**
66 * Create a new instance of {@code ReadOnlyJavaBeanObjectPropertyBuilder}
67 *
68 * @return the new {@code ReadOnlyJavaBeanObjectPropertyBuilder}
69 */
70 public static <T> ReadOnlyJavaBeanObjectPropertyBuilder<T> create() {
71 return new ReadOnlyJavaBeanObjectPropertyBuilder<T>();
72 }
73
74 /**
75 * Generate a new {@link ReadOnlyJavaBeanObjectProperty} with the current settings.
76 *
77 * @return the new {@code ReadOnlyJavaBeanObjectProperty}
78 * @throws NoSuchMethodException if the settings were not sufficient to find
79 * the getter of the Java Bean property
80 */
81 public ReadOnlyJavaBeanObjectProperty<T> build() throws NoSuchMethodException {
82 final ReadOnlyPropertyDescriptor descriptor = helper.getDescriptor();
83 return new ReadOnlyJavaBeanObjectProperty<T>(descriptor, helper.getBean());
84 }
85
86 /**
87 * Set the name of the property
|
48 * All methods to change properties return a reference to this builder, to enable
49 * method chaining.
50 * <p>
51 * If you have to generate adapters for the same property of several instances
52 * of the same class, you can reuse a {@code ReadOnlyJavaBeanObjectPropertyBuilder}.
53 * by switching the Java Bean instance (with {@link #bean(java.lang.Object)} and
54 * calling {@link #build()}.
55 *
56 * @see ReadOnlyJavaBeanObjectProperty
57 *
58 * @param T the type of the wrapped {@code Object}
59 * @since JavaFX 2.1
60 */
61 public final class ReadOnlyJavaBeanObjectPropertyBuilder<T> {
62
63 private final ReadOnlyJavaBeanPropertyBuilderHelper helper = new ReadOnlyJavaBeanPropertyBuilderHelper();
64
65 /**
66 * Create a new instance of {@code ReadOnlyJavaBeanObjectPropertyBuilder}
67 *
68 * @param <T> the type of the wrapped {@code Object}
69 * @return the new {@code ReadOnlyJavaBeanObjectPropertyBuilder}
70 */
71 public static <T> ReadOnlyJavaBeanObjectPropertyBuilder<T> create() {
72 return new ReadOnlyJavaBeanObjectPropertyBuilder<T>();
73 }
74
75 /**
76 * Generate a new {@link ReadOnlyJavaBeanObjectProperty} with the current settings.
77 *
78 * @return the new {@code ReadOnlyJavaBeanObjectProperty}
79 * @throws NoSuchMethodException if the settings were not sufficient to find
80 * the getter of the Java Bean property
81 */
82 public ReadOnlyJavaBeanObjectProperty<T> build() throws NoSuchMethodException {
83 final ReadOnlyPropertyDescriptor descriptor = helper.getDescriptor();
84 return new ReadOnlyJavaBeanObjectProperty<T>(descriptor, helper.getBean());
85 }
86
87 /**
88 * Set the name of the property
|