The goal of this task is to make ShapeShift mapping work with constructor injection, to avoid having to supply object suppliers for every object.
Preliminary conclusions:
- Will probably need special behaviour for java/kotlin
- There doesn't seem to be a way to retrieve default values from constructors
Simplest example:
@DefaultMappingTarget(
class FromClass {
@MappedField
var first: String "first"
@MappedField
var second: String = "second"
}
class ToClass(
val first: String,
val second: String,
val third: String?
)
Should result in a new instance of ToClass with the fields first and second mapped, and the field third being passed to the constructor as null
The goal of this task is to make ShapeShift mapping work with constructor injection, to avoid having to supply object suppliers for every object.
Preliminary conclusions:
Simplest example:
Should result in a new instance of ToClass with the fields first and second mapped, and the field third being passed to the constructor as
null