Package com.vaadin.flow.data.binder
Class ValueContext
java.lang.Object
com.vaadin.flow.data.binder.ValueContext
- All Implemented Interfaces:
Serializable
Value context for
Converters. Contains relevant information for
converting values.- Since:
- 1.0.
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValueContext(Binder<?> binder) Constructor forValueContextwithout aLocale.ValueContext(Binder binder, Component component) Constructor forValueContext.ValueContext(Binder binder, Component component, HasValue<?, ?> hasValue) Constructor forValueContext.ValueContext(Binder binder, Component component, HasValue<?, ?> hasValue, Locale locale) Constructor forValueContext.ValueContext(Binder binder, Locale locale) Constructor forValueContextwithout aComponent. -
Method Summary
Modifier and TypeMethodDescriptionReturns anOptionalfor theBinderowning this value context.Returns anOptionalfor theComponentrelated to value conversion.Returns anOptionalfor theHasValueused in the value conversion.Returns anOptionalfor theLocaleused in the value conversion.
-
Constructor Details
-
ValueContext
Constructor forValueContextwithout aLocale.- Parameters:
binder- the Binder using the value context
-
ValueContext
Constructor forValueContextwithout aComponent.- Parameters:
binder- the Binder using the value contextlocale- The locale used with conversion. Can be null.
-
ValueContext
Constructor forValueContext.- Parameters:
binder- the Binder using the value contextcomponent- The component related to current value. Can be null. If the component implementsHasValue, it will be returned bygetHasValue()as well.
-
ValueContext
Constructor forValueContext.- Parameters:
binder- the Binder using the value contextcomponent- The component related to current value. Can be null.hasValue- The value source related to current value. Can be null.
-
ValueContext
Constructor forValueContext.- Parameters:
binder- the Binder using the value contextcomponent- The component can benull.hasValue- The value source related to current value. Can benull.locale- The locale used with conversion. Can benull.
-
-
Method Details
-
getComponent
Returns anOptionalfor theComponentrelated to value conversion.- Returns:
- the optional of component
-
getLocale
Returns anOptionalfor theLocaleused in the value conversion.- Returns:
- the optional of locale
-
getHasValue
Returns anOptionalfor theHasValueused in the value conversion. In certain complicated cases, ex. cross-field validation, HasValue might be not available.- Returns:
- the optional of
HasValue
-
getBinder
Returns anOptionalfor theBinderowning this value context.- Returns:
- the optional of
Binder
-