com.vaadin.flow.data.renderer.
Class LocalDateRenderer<SOURCE>
Type Parameters:
SOURCE
- the type of the input item, from which the LocalDate
is
extracted
All Implemented Interfaces:
A renderer for presenting date values.
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLocalDateRenderer
(ValueProvider<SOURCE, LocalDate> valueProvider) Creates a new LocalDateRenderer.
LocalDateRenderer
(ValueProvider<SOURCE, LocalDate> valueProvider, SerializableSupplier<DateTimeFormatter> formatter) Creates a new LocalDateRenderer.
LocalDateRenderer
(ValueProvider<SOURCE, LocalDate> valueProvider, SerializableSupplier<DateTimeFormatter> formatter, String nullRepresentation) Creates a new LocalDateRenderer.
LocalDateRenderer
(ValueProvider<SOURCE, LocalDate> valueProvider, String formatPattern) Creates a new LocalDateRenderer.
LocalDateRenderer
(ValueProvider<SOURCE, LocalDate> valueProvider, String formatPattern, Locale locale) Creates a new LocalDateRenderer.
LocalDateRenderer
(ValueProvider<SOURCE, LocalDate> valueProvider, String formatPattern, Locale locale, String nullRepresentation) Creates a new LocalDateRenderer.
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getFormattedValue
(LocalDate date) Gets the String representation of the target object, to be used inside the template.
Methods inherited from class com.vaadin.flow.data.renderer.BasicRenderer
createComponent, getTemplateExpression, getValueProvider
Methods inherited from class com.vaadin.flow.data.renderer.ComponentRenderer
render, updateComponent
Methods inherited from class com.vaadin.flow.data.renderer.LitRenderer
getValueProviders, of, withFunction, withFunction, withProperty
-
Constructor Details
-
LocalDateRenderer
Creates a new LocalDateRenderer.
The renderer is configured with the format style
FormatStyle.LONG
and an empty string as its null representation.Parameters:
valueProvider
- the callback to provide aLocalDate
to the renderer, notnull
See Also:
-
LocalDateRenderer
Creates a new LocalDateRenderer.
The renderer is configured to render with the given string format, with an empty string as its null representation.
Parameters:
valueProvider
- the callback to provide aLocalDate
to the renderer, notnull
formatPattern
- the format pattern to format the date with, notnull
See Also:
-
LocalDateRenderer
public LocalDateRenderer(ValueProvider<SOURCE, LocalDate> valueProvider, String formatPattern, Locale locale) Creates a new LocalDateRenderer.
The renderer is configured to render with the given string format, as displayed in the given locale, with an empty string as its null representation.
Parameters:
valueProvider
- the callback to provide aLocalDate
to the renderer, notnull
formatPattern
- the format pattern to format the date with, notnull
locale
- the locale to use, notnull
See Also:
-
LocalDateRenderer
public LocalDateRenderer(ValueProvider<SOURCE, LocalDate> valueProvider, String formatPattern, Locale locale, String nullRepresentation) Creates a new LocalDateRenderer.
The renderer is configured to render with the given string format, as displayed in the given locale.
Parameters:
valueProvider
- the callback to provide aLocalDate
to the renderer, notnull
formatPattern
- the format pattern to format the date with, notnull
locale
- the locale to use, notnull
nullRepresentation
- the textual representation of thenull
valueSee Also:
-
LocalDateRenderer
public LocalDateRenderer(ValueProvider<SOURCE, LocalDate> valueProvider, SerializableSupplier<DateTimeFormatter> formatter) Creates a new LocalDateRenderer.
The renderer is configured to render with the given formatter, with an empty string as its null representation.
Parameters:
valueProvider
- the callback to provide aLocalDate
to the renderer, notnull
formatter
- the formatter to use, notnull
-
LocalDateRenderer
public LocalDateRenderer(ValueProvider<SOURCE, LocalDate> valueProvider, SerializableSupplier<DateTimeFormatter> formatter, String nullRepresentation) Creates a new LocalDateRenderer.
The renderer is configured to render with the given formatter.
Parameters:
valueProvider
- the callback to provide aLocalDate
to the renderer, notnull
formatter
- the formatter to use, notnull
nullRepresentation
- the textual representation of thenull
value
-
-
Method Details
-
getFormattedValue
Description copied from class:
BasicRenderer
Gets the String representation of the target object, to be used inside the template.
By default it uses
String.valueOf(Object)
of the object.Overrides:
getFormattedValue
in classBasicRenderer<SOURCE,
LocalDate> Parameters:
date
- the target objectReturns:
the string representation of the object
-