Modules
Konvert is split into multiple modules.
The most important modules for the usage are:
-
konvert-apiThis module brings the module
konvert-annotationswith it and adds constants for available converter names and option keys.-
konvert-annotationsThis module contains mainly annotations which you can use to annotate your classes or mapper interfaces to generate mapping code by
Konvert.
-
-
konvertThis is the module which bundles
konvert-processorandkonvert-convertertogether, so that you can simply use this module as your KSP processor.-
konvert-converterContains all the default
TypeConverters ofKonvert. See here to view them all. -
konvert-processorThis is the module which contains the actual KSP implementation, which will process the annotations, collect annotated converters and generate code for each mapping.
-
To extend the functionality of Konvert the following modules are provided
-
konvert-converter-apiThis module can be used to build your own
TypeConverters to be used by Konvert during compilation. As Konvert is using SPI, you can build your own library and just include it into KSP classpath! (TODO: reference example) -
This module can be used to build your own plugins for
Konvertto amend the behaviour of the processor (e.g. to add annotations to the generated source code).The following plugins are already available:
-
Generate Anvil annotations (e.g.
@Singleton) by usingkonvert-anvil-annotationsandkonvert-anvil-injector -
Generate CDI annotations (e.g.
@RequestScoped) by usingkonvert-cdi-annotationsandkonvert-cdi-injector -
Generate Koin annotations (e.g.
@Single) by usingkonvert-koin-annotationsandkonvert-koin-injector -
Generate Spring annotations (e.g.
@Component) by usingkonvert-spring-annotationsandkonvert-spring-injector
-