public class LocalDateTimeRenderer extends AbstractRenderer<Object,LocalDateTime>
LocalDateTime
objects.ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Constructor and Description |
---|
LocalDateTimeRenderer()
Creates a new LocalDateTimeRenderer.
|
LocalDateTimeRenderer(DateTimeFormatter formatter)
Deprecated.
the method is unsafe for serialization, may produce troubles
in a cluster environment
|
LocalDateTimeRenderer(DateTimeFormatter formatter,
String nullRepresentation)
Deprecated.
the method is unsafe for serialization, may produce troubles
in acluster environment
|
LocalDateTimeRenderer(SerializableSupplier<DateTimeFormatter> formatterSupplier)
Creates a new LocalDateTimeRenderer.
|
LocalDateTimeRenderer(SerializableSupplier<DateTimeFormatter> formatterSupplier,
String nullRepresentation)
Creates a new LocalDateTimeRenderer.
|
LocalDateTimeRenderer(String formatPattern)
Creates a new LocalDateTimeRenderer.
|
LocalDateTimeRenderer(String formatPattern,
Locale locale)
Creates a new LocalDateTimeRenderer.
|
LocalDateTimeRenderer(String formatPattern,
Locale locale,
String nullRepresentation)
Creates a new LocalDateTimeRenderer.
|
Modifier and Type | Method and Description |
---|---|
JsonValue |
encode(LocalDateTime value)
Encodes the given value into a
JsonValue . |
protected LocalDateTimeRendererState |
getState()
Returns the shared state for this connector.
|
protected LocalDateTimeRendererState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
encode, extend, getNullRepresentation, getParent, getParentGrid, getPresentationType, getSupportedParentType
remove, setParent
addAttachListener, addDetachListener, addExtension, 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, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
public LocalDateTimeRenderer()
The renderer is configured to render with the grid's locale it is
attached to, with the format style being FormatStyle.LONG
for the
date and FormatStyle.SHORT
for time, with an empty string as its
null representation.
@Deprecated public LocalDateTimeRenderer(DateTimeFormatter formatter)
The renderer is configured to render with the given formatter, with the 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
.
formatter
- the formatter to use, not null
IllegalArgumentException
- if formatter is nullLocalDateTimeRenderer(SerializableSupplier)
@Deprecated public LocalDateTimeRenderer(DateTimeFormatter formatter, String nullRepresentation)
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
.
formatter
- the formatter to use, not null
nullRepresentation
- the textual representation of the null
valueIllegalArgumentException
- if formatter is nullLocalDateTimeRenderer(SerializableSupplier, String)
public LocalDateTimeRenderer(String formatPattern)
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.
formatPattern
- the format pattern to format the date with, not null
IllegalArgumentException
- if format pattern is nullpublic LocalDateTimeRenderer(String formatPattern, Locale locale)
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.
formatPattern
- the format pattern to format the date with, not null
locale
- the locale to use, not null
IllegalArgumentException
- if format pattern is nullIllegalArgumentException
- if locale is nullpublic LocalDateTimeRenderer(String formatPattern, Locale locale, String nullRepresentation)
The renderer is configured to render with the given string format, as displayed in the given locale.
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
valueIllegalArgumentException
- if format pattern is nullIllegalArgumentException
- if locale is nullpublic LocalDateTimeRenderer(SerializableSupplier<DateTimeFormatter> formatterSupplier)
The renderer is configured to render with the given formatterSupplier.
formatterSupplier
- the formatterSupplier supplier to use, not null
, it
should not supply null
eitherIllegalArgumentException
- if formatterSupplier is nullpublic LocalDateTimeRenderer(SerializableSupplier<DateTimeFormatter> formatterSupplier, String nullRepresentation)
The renderer is configured to render with the given formatterSupplier.
formatterSupplier
- the formatterSupplier supplier to use, not null
, it
should not supply null
eithernullRepresentation
- the textual representation of the null
valueIllegalArgumentException
- if formatterSupplier is nullpublic JsonValue encode(LocalDateTime value)
Renderer
JsonValue
.encode
in interface Renderer<LocalDateTime>
encode
in class AbstractRenderer<Object,LocalDateTime>
value
- the value to encodeprotected LocalDateTimeRendererState getState()
AbstractClientConnector
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.
getState
in class AbstractRenderer<Object,LocalDateTime>
protected LocalDateTimeRendererState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractRenderer<Object,LocalDateTime>
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
Copyright © 2018 Vaadin Ltd. All rights reserved.