java.lang.Object
io.avaje.jex.core.JsonbJsonService
- All Implemented Interfaces:
JsonService
Provides JsonService using avaje-jsonb.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate with defaults for Jsonb.JsonbJsonService(io.avaje.jsonb.Jsonb jsonb) Create with a Jsonb instance that might have custom configuration. -
Method Summary
Modifier and TypeMethodDescription<T> TjsonRead(Class<T> clazz, SpiContext ctx) Read the request body as a bean and return the bean.voidjsonWrite(Object bean, SpiContext ctx) Write the bean as JSON response content.<T> voidjsonWriteStream(Iterator<T> iterator, SpiContext ctx) Write the beans as x-json-stream JSON with new line delimiter.
-
Constructor Details
-
JsonbJsonService
public JsonbJsonService()Create with defaults for Jsonb. -
JsonbJsonService
public JsonbJsonService(io.avaje.jsonb.Jsonb jsonb) Create with a Jsonb instance that might have custom configuration.
-
-
Method Details
-
jsonRead
Description copied from interface:JsonServiceRead the request body as a bean and return the bean.- Specified by:
jsonReadin interfaceJsonService
-
jsonWrite
Description copied from interface:JsonServiceWrite the bean as JSON response content.- Specified by:
jsonWritein interfaceJsonService
-
jsonWriteStream
Description copied from interface:JsonServiceWrite the beans as x-json-stream JSON with new line delimiter.- Specified by:
jsonWriteStreamin interfaceJsonService
-