com.vaadin.ui.renderers.

Class LocalDateRenderer

    • Constructor Detail

      • LocalDateRenderer

        public LocalDateRenderer()

        Creates a new LocalDateRenderer.

        The renderer is configured to render with the grid's locale it is attached to, with the format style being FormatStyle.LONG and an empty string as its null representation.

        See Also:

        FormatStyle.LONG

      • LocalDateRenderer

        public LocalDateRenderer​(String formatPattern)

        Creates a new LocalDateRenderer.

        The renderer is configured to render with the given string format, as displayed in the grid's locale it is attached to, with an empty string as its null representation.

        Parameters:

        formatPattern - the format pattern to format the date with, not null

        Throws:

        IllegalArgumentException - if format pattern is null

        See Also:

        Format Pattern Syntax

      • LocalDateRenderer

        public LocalDateRenderer​(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:

        formatPattern - the format pattern to format the date with, not null

        locale - the locale to use, not null

        Throws:

        IllegalArgumentException - if format pattern is null

        IllegalArgumentException - if locale is null

        See Also:

        Format Pattern Syntax

      • LocalDateRenderer

        public LocalDateRenderer​(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:

        formatPattern - the format pattern to format the date with, not null

        locale - the locale to use, not null

        nullRepresentation - the textual representation of the null value

        Throws:

        IllegalArgumentException - if format pattern is null

        IllegalArgumentException - if locale is null

        See Also:

        Format Pattern Syntax

      • LocalDateRenderer

        @Deprecated
        public LocalDateRenderer​(DateTimeFormatter formatter)
        Deprecated.
        the method is unsafe for serialization, may produce troubles in a cluster environment

        Creates a new LocalDateRenderer.

        The renderer is configured to render with the given formatter, with an empty string as its null representation.

        Note the DateTimeFormatter is not a serializable class, so using this method in an environment which requires session persistence may produce NotSerializableException.

        Parameters:

        formatter - the formatter to use, not null

        Throws:

        IllegalArgumentException - if formatter is null

        See Also:

        LocalDateRenderer(SerializableSupplier)

      • LocalDateRenderer

        public LocalDateRenderer​(SerializableSupplier<DateTimeFormatter> formatterSupplier,
                                 String nullRepresentation)

        Creates a new LocalDateRenderer.

        The renderer is configured to render with the given formatterSupplier.

        Parameters:

        formatterSupplier - the formatterSupplier supplier to use, not null, it should not supply null either

        nullRepresentation - the textual representation of the null value

        Throws:

        IllegalArgumentException - if formatterSupplier is null

      • LocalDateRenderer

        public LocalDateRenderer​(SerializableSupplier<DateTimeFormatter> formatterSupplier)

        Creates a new LocalDateRenderer.

        The renderer is configured to render with the given formatterSupplier.

        Parameters:

        formatterSupplier - the formatterSupplier supplier to use, not null, it should not supply null either

        Throws:

        IllegalArgumentException - if formatterSupplier is null

      • LocalDateRenderer

        @Deprecated
        public LocalDateRenderer​(DateTimeFormatter formatter,
                                 String nullRepresentation)
        Deprecated.
        the method is unsafe for serialization, may produce troubles in acluster environment

        Creates a new LocalDateRenderer.

        The renderer is configured to render with the given formatter.

        Note the DateTimeFormatter is not a serializable class, so using this method in an environment which requires session persistence may produce NotSerializableException.

        Parameters:

        formatter - the formatter to use, not null

        nullRepresentation - the textual representation of the null value

        Throws:

        IllegalArgumentException - if formatter is null

        See Also:

        LocalDateRenderer(SerializableSupplier, String)

    • Method Detail

      • getState

        protected LocalDateRendererState getState()

        Description copied from class: AbstractClientConnector

        Returns the shared state for this connector. The shared state object is shared between the server connector and the client connector. Changes are only communicated from the server to the client and not in the other direction.

        As a side effect, marks the connector dirty so any changes done to the state will be sent to the client. Use getState(false) to avoid marking the connector as dirty.

        Overrides:

        getState in class AbstractRenderer<Object,​LocalDate>

        Returns:

        The shared state for this connector. Never null.