Class LocalDateRenderer
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.renderers.AbstractRenderer<Object,LocalDate>
-
- com.vaadin.ui.renderers.LocalDateRenderer
-
- All Implemented Interfaces:
MethodEventSource,ClientConnector,Extension,Connector,Renderer<LocalDate>,Serializable
public class LocalDateRenderer extends AbstractRenderer<Object,LocalDate>
A renderer for presenting date values.- Since:
- 8.1
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
-
Constructor Summary
Constructors Constructor Description LocalDateRenderer()Creates a new LocalDateRenderer.LocalDateRenderer(SerializableSupplier<DateTimeFormatter> formatterSupplier)Creates a new LocalDateRenderer.LocalDateRenderer(SerializableSupplier<DateTimeFormatter> formatterSupplier, String nullRepresentation)Creates a new LocalDateRenderer.LocalDateRenderer(String formatPattern)Creates a new LocalDateRenderer.LocalDateRenderer(String formatPattern, Locale locale)Creates a new LocalDateRenderer.LocalDateRenderer(String formatPattern, Locale locale, String nullRepresentation)Creates a new LocalDateRenderer.LocalDateRenderer(DateTimeFormatter formatter)Deprecated.the method is unsafe for serialization, may produce troubles in a cluster environmentLocalDateRenderer(DateTimeFormatter formatter, String nullRepresentation)Deprecated.the method is unsafe for serialization, may produce troubles in acluster environment
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description elemental.json.JsonValueencode(LocalDate value)Encodes the given value into aJsonValue.protected LocalDateRendererStategetState()Returns the shared state for this connector.protected LocalDateRendererStategetState(boolean markAsDirty)Returns the shared state for this connector.-
Methods inherited from class com.vaadin.ui.renderers.AbstractRenderer
encode, extend, getNullRepresentation, getParent, getParentGrid, getPresentationType, getSupportedParentType
-
Methods inherited from class com.vaadin.server.AbstractExtension
remove, setParent
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
-
-
-
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.LONGand 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, notnull- 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, notnulllocale- the locale to use, notnull- Throws:
IllegalArgumentException- if format pattern is nullIllegalArgumentException- 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, notnulllocale- the locale to use, notnullnullRepresentation- the textual representation of thenullvalue- Throws:
IllegalArgumentException- if format pattern is nullIllegalArgumentException- 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 environmentCreates a new LocalDateRenderer.The renderer is configured to render with the given formatter, with an empty string as its null representation.
Note the
DateTimeFormatteris not a serializable class, so using this method in an environment which requires session persistence may produceNotSerializableException.- Parameters:
formatter- the formatter to use, notnull- 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, notnull, it should not supplynulleithernullRepresentation- the textual representation of thenullvalue- 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, notnull, it should not supplynulleither- 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 environmentCreates a new LocalDateRenderer.The renderer is configured to render with the given formatter.
Note the
DateTimeFormatteris not a serializable class, so using this method in an environment which requires session persistence may produceNotSerializableException.- Parameters:
formatter- the formatter to use, notnullnullRepresentation- the textual representation of thenullvalue- Throws:
IllegalArgumentException- if formatter is null- See Also:
LocalDateRenderer(SerializableSupplier, String)
-
-
Method Detail
-
encode
public elemental.json.JsonValue encode(LocalDate value)
Description copied from interface:RendererEncodes the given value into aJsonValue.
-
getState
protected LocalDateRendererState getState()
Description copied from class:AbstractClientConnectorReturns 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:
getStatein classAbstractRenderer<Object,LocalDate>- Returns:
- The shared state for this connector. Never null.
-
getState
protected LocalDateRendererState getState(boolean markAsDirty)
Description copied from class:AbstractClientConnectorReturns the shared state for this connector.- Overrides:
getStatein classAbstractRenderer<Object,LocalDate>- Parameters:
markAsDirty- true if the connector should automatically be marked dirty, false otherwise- Returns:
- The shared state for this connector. Never null.
- See Also:
AbstractClientConnector.getState()
-
-