Class Grid.AbstractRenderer<T>

    • Constructor Detail

      • AbstractRenderer

        protected AbstractRenderer​(Class<T> presentationType,
                                   String nullRepresentation)
        Deprecated.
      • AbstractRenderer

        protected AbstractRenderer​(Class<T> presentationType)
        Deprecated.
    • Method Detail

      • getPresentationType

        public Class<T> getPresentationType()
        Deprecated.
        Description copied from interface: Renderer
        Returns the class literal corresponding to the presentation type T.
        Specified by:
        getPresentationType in interface Renderer<T>
        Returns:
        the class literal of T
      • encode

        public elemental.json.JsonValue encode​(T value)
        Deprecated.
        Description copied from interface: Renderer
        Encodes the given value into a JsonValue.
        Specified by:
        encode in interface Renderer<T>
        Parameters:
        value - the value to encode
        Returns:
        a JSON representation of the given value
      • getNullRepresentation

        protected String getNullRepresentation()
        Deprecated.
        Null representation for the renderer.
        Returns:
        a textual representation of null
      • encode

        protected <U> elemental.json.JsonValue encode​(U value,
                                                      Class<U> type)
        Deprecated.
        Encodes the given value to JSON.

        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).

        Parameters:
        value - the value to be encoded
        type - the type of the value
        Returns:
        a JSON representation of the given value
      • encodeValue

        public static <T> elemental.json.JsonValue encodeValue​(Object modelValue,
                                                               Renderer<T> renderer,
                                                               Converter<?,​?> converter,
                                                               Locale locale)
        Deprecated.
        Converts and encodes the given data model property value using the given converter and renderer. This method is public only for testing purposes.
        Parameters:
        renderer - the renderer to use
        converter - the converter to use
        modelValue - the value to convert and encode
        locale - the locale to use in conversion
        Returns:
        an encoded value ready to be sent to the client
        Since:
        7.6