Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public interface Json.Encoder

Writes values of one type as JSON, shared by every request that answers with that type.

The stateless counterpart of Writable. A Writable carries the value it writes, so a route answering with a codec had to allocate one per request to hold that value; an Encoder is handed the value instead, so a generated route keeps ONE in a static field and a request allocates only what the method returned. See HttpServer.Request.respondJson(int, Object, Encoder).

Methods

public abstract void write(Object value, ByteSink out)Writes value, never null, into out.

Method details

write

public abstract void write(Object value, ByteSink out)
Writes value, never null, into out.