Skip to content

Code Generation Configuration

ozangunalp edited this page Aug 2, 2018 · 1 revision

The basic configuration for dOOv code generation is pretty simple and needs three mandatory properties : packageFilter, fieldClass and sourceClass.

dOOv code generator has a couple more configurations to cover different usage scenarios.

baseClass

Fully qualified class name of the abstract base class of the generated Wrapper class.

By default generated Wrapper extends the abstract class io.doov.core.AbstractWrapper. Given class must be abstract and itself extend the io.doov.core.AbstractWrapper.

Default : io.doov.core.AbstractWrapper

fieldInfoTypes

Fully qualified class name of the class that provides type associations between Java field types and FieldInfo types. Code generator uses these associations to generate strongly typed DSL fields in the generated Dsl class.

By default dOOv supports all Java primitive types, Enum, List, String, LocalDate, LocalTime, LocalDateTime; and provides the default association in io.doov.core.dsl.field.FieldTypes. All other types that does not have the association will have io.doov.core.dsl.field.DefaultFieldInfo type.

To provide different and custom field types the given class must implement the interface io.doov.core.dsl.field.FieldTypeProvider, and provide a map of Map<Predicate<FieldInfo>, Class<? extends FieldInfo>>, as well as the default field info implementation.

Default : io.doov.core.dsl.field.FieldTypes

typeAdapters

Fully qualified class name of the the type registry implementation. Type adapters implement the serialization-deserialization logic of field values. A custom type adapter registry can provide alternative serialization-deserialization implementaions. The given class must implement the io.doov.core.serial.TypeAdapterRegistry interface.

Default : io.doov.core.serial.TypeAdapters

wrapperPackage

Package name of the generated Wrapper class

Default : source class package name

fieldInfoPackage

Package name of the generated FieldInfo class

Default : field class package name

dslModelPackage

Package name of the generated DslModel class

Default : [field class package name].dsl

enumFieldInfo

Flag to generate an enum for FieldInfo. if given false, code generator will generate a final class.

Default : true

dslEntrypointMethods

Flag to generate helper methods that serve as entrypoint to the DSL in DslModel class.

Default : true