English | 简体中文

api-docs / me.liuwj.ktorm.jackson / KtormModule

KtormModule

class KtormModule : Module (source code)

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

Constructors

NameSummary

<init>

KtormModule()

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

Functions

NameSummary

getModuleName

fun getModuleName(): String

setupModule

fun setupModule(context: SetupContext): Unit

version

fun version(): Version