Class JsonExtension
java.lang.Object
dev.relism.flash.ext.jackson.json.JsonExtension
- All Implemented Interfaces:
dev.relism.flash.extension.FlashExtension
JSON for an application: the
Json codec, the mapper behind it, and the middleware that
serializes whatever a handler returns.
JsonExtension json = new JsonExtension();
app.install(json).use(json.auto());
The default mapper discovers the modules on the classpath (Java Time among them) and writes dates as ISO strings. Hand it a mapper of your own to decide otherwise.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JsonExtension
public JsonExtension() -
JsonExtension
public JsonExtension(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
auto
public dev.relism.flash.routing.Middleware auto()Serializes what a handler returns, unless it already returned a response, bytes or text. -
configure
public void configure(dev.relism.flash.extension.FlashRegistrar<?> app, dev.relism.flash.extension.FlashContext ctx) - Specified by:
configurein interfacedev.relism.flash.extension.FlashExtension
-