English | 简体中文

api-docs / org.ktorm.jackson / KtormModule / <init>

<init>

KtormModule()

Jackson Module implementation that supports serializing Ktorm’s entity objects in JSON format.

Entity classes in Ktorm are defined as interfaces, and entity objects are created by JDK dynamic proxy.
That’s why Jackson cannot serialize entity objects by default (because they are not normal Java classes).
This module provides the Jackson serialization support for Ktorm.

To enable this module, you need to call the ObjectMapper.registerModule method to register it to Jackson.
You can also call ObjectMapper.findAndRegisterModules to automatically find and register it using JDK
ServiceLoader facility. For more details, please see Jackson’s documentation.

See Also

Entity

ObjectMapper.registerModule

ObjectMapper.findAndRegisterModules