makeOperation method

Operation<MappingContext> makeOperation(
  1. SourceNode sourceNode,
  2. Mapper mapper
)

Implementation

Operation<MappingContext> makeOperation(SourceNode sourceNode, Mapper mapper) {
  var sourceProperty = sourceNode.fetchProperty!;

  var deep = match!.deep;
  var conversion = calculateConversion(sourceNode);

  // compute operation

  var requiresWrite = parent!.resultDefinition == null;

  var writeProperty = accessor.makeTransformerProperty(requiresWrite) ;// property, constant or synchronizer

  if (parent!.resultDefinition != null) {
    parent!.resultDefinition!.missing -= 1;

    writeProperty = SetResultArgument(
      resultDefinition: parent!.resultDefinition!,
      index: accessor.index,
      property: writeProperty
    );
  }

  if ( deep )
    writeProperty = mapDeep(mapper, sourceNode.accessor, accessor, writeProperty);
  else
    writeProperty = maybeConvert(writeProperty, conversion);

  return Operation(sourceProperty, writeProperty);
}