set method
Write a property value given an instance
instance
the instance
value
the value to write
context
the context object
Implementation
@override
void set(dynamic instance,dynamic value, MappingContext context) {
if (polymorphic) {
targetProperty.set(
instance, mapper.map(value, context: context, mapping: mapper.getSourceMapping(value.runtimeType)),
context); // recursive call!
}
else {
mapping ??= mapper.getMappingX(sourceType, targetProperty.getType());
targetProperty.set(
instance, mapper.map(value, context: context, mapping: mapping),
context); // recursive call!
}
}