T
- the type this renderer knows how to presentpublic abstract static class Grid.AbstractRenderer<T> extends Grid.AbstractGridExtension implements Renderer<T>
Grid renderers
.
This class currently extends the AbstractExtension superclass, but this
fact should be regarded as an implementation detail and subject to change
in a future major or minor Vaadin revision.ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Modifier | Constructor and Description |
---|---|
protected |
AbstractRenderer(Class<T> presentationType) |
protected |
AbstractRenderer(Class<T> presentationType,
String nullRepresentation) |
Modifier and Type | Method and Description |
---|---|
JsonValue |
encode(T value)
Encodes the given value into a
JsonValue . |
protected <U> JsonValue |
encode(U value,
Class<U> type)
Encodes the given value to JSON.
|
static <T> JsonValue |
encodeValue(Object modelValue,
Renderer<T> renderer,
Converter<?,?> converter,
Locale locale)
Converts and encodes the given data model property value using the
given converter and renderer.
|
protected void |
extend(AbstractClientConnector target)
Deprecated.
|
protected String |
getNullRepresentation()
Null representation for the renderer
|
Class<T> |
getPresentationType()
Returns the class literal corresponding to the presentation type T.
|
protected Class<Grid> |
getSupportedParentType()
Deprecated.
|
addComponentToGrid, getColumn, getItemId, getParentGrid, refreshRow, remove, removeComponentFromGrid
getParent, setParent
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getParent, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
@Deprecated protected Class<Grid> getSupportedParentType()
getSupportedParentType
in class AbstractExtension
@Deprecated protected void extend(AbstractClientConnector target)
extend
in class Grid.AbstractGridExtension
target
- the connector to attach this extension topublic Class<T> getPresentationType()
Renderer
getPresentationType
in interface Renderer<T>
public JsonValue encode(T value)
Renderer
JsonValue
.protected String getNullRepresentation()
null
protected <U> JsonValue encode(U value, Class<U> type)
This is a helper method that can be invoked by an
encode(T)
override if serializing a value of
type other than the presentation type
is desired. For instance, a Renderer<Date>
could first turn a
date value into a formatted string and return
encode(dateString, String.class)
.
value
- the value to be encodedtype
- the type of the valuepublic static <T> JsonValue encodeValue(Object modelValue, Renderer<T> renderer, Converter<?,?> converter, Locale locale)
renderer
- the renderer to useconverter
- the converter to usemodelValue
- the value to convert and encodelocale
- the locale to use in conversionCopyright © 2019 Vaadin Ltd. All rights reserved.