Class ComponentAttribute.Builder<T>
java.lang.Object
de.xima.fc.gui.util.ComponentAttribute.Builder<T>
- Type Parameters:
T- The expected type of the attribute value.
- Enclosing class:
ComponentAttribute<T>
Builder for creating instances of
ComponentAttribute with a fluent API for configuration.- Since:
- 8.5.3
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newComponentAttributeinstance based on the configuration of this builder.initialValue(Supplier<? extends T> initialValue) Sets the supplier for the initial value of the attribute.Throws when invoking a method expression if no compatible method is found for the attribute.throwOnMethodNotFound(boolean throwOnMethodNotFound) Sets whether to throw when invoking a method expression if no compatible method is found for the attribute.Throws when getting the value of the attribute and no value is present (no value expression and no literal attribute).throwOnMissingValue(boolean throwOnMissingValue) Whether to throw when getting the value of the attribute and no value is present (no value expression and no literal attribute).Throws when getting the value of the attribute and the resolved value is null.throwOnNonNullValue(boolean throwOnNullValue) Whether to throw when getting the value of the attribute and the resolved value is null.Throws when trying to set a value for the attribute if no value expression is defined or the value expression does not refer to a writable property (no setter).throwOnNonWritableProperty(boolean throwOnNonWritableProperty) Sets whether to throw when trying to set a value for the attribute if no value expression is defined or the value expression does not refer to a writable property (no setter).
-
Method Details
-
build
Creates a newComponentAttributeinstance based on the configuration of this builder.- Returns:
- A new ComponentAttribute instance.
-
initialValue
Sets the supplier for the initial value of the attribute. When set, this value is used when getting the attribute and no value is currently present. Defaults to null (no initial value).- Parameters:
initialValue- The supplier for the initial value of the attribute.- Returns:
- This builder instance for method chaining.
-
throwOnMethodNotFound
Sets whether to throw when invoking a method expression if no compatible method is found for the attribute. Defaults to false.- Parameters:
throwOnMethodNotFound- Whether to throw when a method is not found.- Returns:
- This builder instance for method chaining.
-
throwOnMethodNotFound
Throws when invoking a method expression if no compatible method is found for the attribute. Defaults to false.- Returns:
- This builder instance for method chaining.
-
throwOnMissingValue
Whether to throw when getting the value of the attribute and no value is present (no value expression and no literal attribute). This allows an existing value that just happens to be null. UsethrowOnNonNullValue()to forbid null values. Defaults to false.- Parameters:
throwOnMissingValue- Whether to throw when no value is present for the attribute.- Returns:
- This builder instance for method chaining.
-
throwOnMissingValue
Throws when getting the value of the attribute and no value is present (no value expression and no literal attribute). This allows an existing value that just happens to be null. UsethrowOnNonNullValue()to forbid null values. Defaults to false.- Returns:
- This builder instance for method chaining.
-
throwOnNonNullValue
Whether to throw when getting the value of the attribute and the resolved value is null. Defaults to false.- Parameters:
throwOnNullValue- Whether to throw when the resolved value is null.- Returns:
- This builder instance for method chaining.
- See Also:
-
throwOnNonNullValue
Throws when getting the value of the attribute and the resolved value is null. Defaults to false.- Returns:
- This builder instance for method chaining.
- See Also:
-
throwOnNonWritableProperty
Sets whether to throw when trying to set a value for the attribute if no value expression is defined or the value expression does not refer to a writable property (no setter). Defaults to false.- Parameters:
throwOnNonWritableProperty- Whether to throw when trying to set a value for a non-writable property.- Returns:
- This builder instance for method chaining.
-
throwOnNonWritableProperty
Throws when trying to set a value for the attribute if no value expression is defined or the value expression does not refer to a writable property (no setter). Defaults to false.- Returns:
- This builder instance for method chaining.
-