Class ValueContext

java.lang.Object
com.vaadin.flow.data.binder.ValueContext
All Implemented Interfaces:
Serializable

public class ValueContext extends Object implements Serializable
Value context for Converters. Contains relevant information for converting values.
Since:
1.0.
Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for ValueContext without a Locale.
    ValueContext(com.vaadin.flow.component.Component component)
    Constructor for ValueContext.
    ValueContext(com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue)
    Constructor for ValueContext.
    ValueContext(com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue, Locale locale)
    Constructor for ValueContext.
    ValueContext(Binder<?> binder)
    Constructor for ValueContext without a Locale.
    ValueContext(Binder binder, com.vaadin.flow.component.Component component)
    Constructor for ValueContext.
    ValueContext(Binder binder, com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue)
    Constructor for ValueContext.
    ValueContext(Binder binder, com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue, Locale locale)
    Constructor for ValueContext.
    ValueContext(Binder binder, Locale locale)
    Constructor for ValueContext without a Component.
    Constructor for ValueContext without a Component.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an Optional for the Binder owning this value context.
    Optional<com.vaadin.flow.component.Component>
    Returns an Optional for the Component related to value conversion.
    Optional<com.vaadin.flow.component.HasValue<?,?>>
    Returns an Optional for the HasValue used in the value conversion.
    Returns an Optional for the Locale used in the value conversion.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ValueContext

      public ValueContext()
      Constructor for ValueContext without a Locale.
    • ValueContext

      public ValueContext(Binder<?> binder)
      Constructor for ValueContext without a Locale.
      Parameters:
      binder - the Binder using the value context
    • ValueContext

      public ValueContext(Locale locale)
      Constructor for ValueContext without a Component.
      Parameters:
      locale - The locale used with conversion. Can be null.
    • ValueContext

      public ValueContext(Binder binder, Locale locale)
      Constructor for ValueContext without a Component.
      Parameters:
      binder - the Binder using the value context
      locale - The locale used with conversion. Can be null.
    • ValueContext

      public ValueContext(com.vaadin.flow.component.Component component)
      Constructor for ValueContext.
      Parameters:
      component - The component related to current value. Can be null. If the component implements HasValue, it will be returned by getHasValue() as well.
    • ValueContext

      public ValueContext(Binder binder, com.vaadin.flow.component.Component component)
      Constructor for ValueContext.
      Parameters:
      binder - the Binder using the value context
      component - The component related to current value. Can be null. If the component implements HasValue, it will be returned by getHasValue() as well.
    • ValueContext

      public ValueContext(com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue)
      Constructor for ValueContext.
      Parameters:
      component - The component related to current value. Can be null.
      hasValue - The value source related to current value. Can be null.
    • ValueContext

      public ValueContext(Binder binder, com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue)
      Constructor for ValueContext.
      Parameters:
      binder - the Binder using the value context
      component - The component related to current value. Can be null.
      hasValue - The value source related to current value. Can be null.
    • ValueContext

      public ValueContext(com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue, Locale locale)
      Constructor for ValueContext.
      Parameters:
      component - The component can be null.
      hasValue - The value source related to current value. Can be null.
      locale - The locale used with conversion. Can be null.
    • ValueContext

      public ValueContext(Binder binder, com.vaadin.flow.component.Component component, com.vaadin.flow.component.HasValue<?,?> hasValue, Locale locale)
      Constructor for ValueContext.
      Parameters:
      binder - the Binder using the value context
      component - The component can be null.
      hasValue - The value source related to current value. Can be null.
      locale - The locale used with conversion. Can be null.
  • Method Details

    • getComponent

      public Optional<com.vaadin.flow.component.Component> getComponent()
      Returns an Optional for the Component related to value conversion.
      Returns:
      the optional of component
    • getLocale

      public Optional<Locale> getLocale()
      Returns an Optional for the Locale used in the value conversion.
      Returns:
      the optional of locale
    • getHasValue

      public Optional<com.vaadin.flow.component.HasValue<?,?>> getHasValue()
      Returns an Optional for the HasValue used in the value conversion. In certain complicated cases, ex. cross-field validation, HasValue might be not available.
      Returns:
      the optional of HasValue
    • getBinder

      public Optional<Binder<?>> getBinder()
      Returns an Optional for the Binder owning this value context.
      Returns:
      the optional of Binder