set method

  1. @override
void set(
  1. dynamic instance,
  2. dynamic value,
  3. MappingContext context
)
override

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!
  }
}