Class LocalDateTimeRenderer<SOURCE>
- Type Parameters:
SOURCE- the type of the input item, from which theLocalDateTimeis extracted
- All Implemented Interfaces:
Serializable
LocalDateTime objects.- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider) Creates a new LocalDateTimeRenderer.LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, SerializableSupplier<DateTimeFormatter> formatter) Creates a new LocalDateTimeRenderer.LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, SerializableSupplier<DateTimeFormatter> formatter, String nullRepresentation) Creates a new LocalDateTimeRenderer.LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, String formatPattern) Creates a new LocalDateTimeRenderer.LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, String formatPattern, Locale locale) Creates a new LocalDateTimeRenderer.LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, String formatPattern, Locale locale, String nullRepresentation) Creates a new LocalDateTimeRenderer. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetFormattedValue(LocalDateTime dateTime) 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, getValueProviderMethods inherited from class com.vaadin.flow.data.renderer.ComponentRenderer
render, updateComponentMethods inherited from class com.vaadin.flow.data.renderer.LitRenderer
getValueProviders, of, withFunction, withFunction, withProperty
-
Constructor Details
-
LocalDateTimeRenderer
Creates a new LocalDateTimeRenderer.The renderer is configured to render with the format style
FormatStyle.LONGfor the date andFormatStyle.SHORTfor time, with an empty string as its null representation.- Parameters:
valueProvider- the callback to provide aLocalDateTimeto the renderer, notnull- See Also:
-
LocalDateTimeRenderer
public LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, SerializableSupplier<DateTimeFormatter> formatter) Creates a new LocalDateTimeRenderer.The renderer is configured to render with the given formatter, with the empty string as its null representation.
- Parameters:
valueProvider- the callback to provide aLocalDateTimeto the renderer, notnullformatter- the formatter to use, notnull
-
LocalDateTimeRenderer
public LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, SerializableSupplier<DateTimeFormatter> formatter, String nullRepresentation) Creates a new LocalDateTimeRenderer.The renderer is configured to render with the given formatter.
- Parameters:
valueProvider- the callback to provide aLocalDateTimeto the renderer, notnullformatter- the formatter to use, notnullnullRepresentation- the textual representation of thenullvalue
-
LocalDateTimeRenderer
public LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, String formatPattern) Creates a new LocalDateTimeRenderer.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 aLocalDateTimeto the renderer, notnullformatPattern- the format pattern to format the date with, notnull- See Also:
-
LocalDateTimeRenderer
public LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, String formatPattern, Locale locale) Creates a new LocalDateTimeRenderer.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 aLocalDateTimeto the renderer, notnullformatPattern- the format pattern to format the date with, notnulllocale- the locale to use, notnull- See Also:
-
LocalDateTimeRenderer
public LocalDateTimeRenderer(ValueProvider<SOURCE, LocalDateTime> valueProvider, String formatPattern, Locale locale, String nullRepresentation) Creates a new LocalDateTimeRenderer.The renderer is configured to render with the given string format, as displayed in the given locale.
- Parameters:
valueProvider- the callback to provide aLocalDateTimeto the renderer, notnullformatPattern- the format pattern to format the date with, notnulllocale- the locale to use, notnullnullRepresentation- the textual representation of thenullvalue- See Also:
-
-
Method Details
-
getFormattedValue
Description copied from class:BasicRendererGets the String representation of the target object, to be used inside the template.By default it uses
String.valueOf(Object)of the object.- Overrides:
getFormattedValuein classBasicRenderer<SOURCE,LocalDateTime> - Parameters:
dateTime- the target object- Returns:
- the string representation of the object
-