Class JsonEncoder


  • public class JsonEncoder
    extends Object
    Encoder for converting RPC parameters and other values to JSON for transfer between the client and the server. Currently, basic data types as well as Map, String[] and Object[] are supported, where maps and Object[] can contain other supported data types. TODO extensible type support
    Since:
    7.0
    • Method Detail

      • encode

        public static elemental.json.JsonValue encode​(Object value,
                                                      Type type,
                                                      ApplicationConnection connection)
        Encode a value to a JSON representation for transport from the client to the server.
        Parameters:
        value - value to convert
        type - type information, not needed for all encoding tasks, such as encoding a String
        connection - application connection providing the context, not needed for all encoding tasks, such as encoding a String
        Returns:
        JSON representation of the value