Interface MappingBuilderContext.MappingResolver

All Known Implementing Classes:
MappingResolverImpl
Enclosing class:
MappingBuilderContext

public static interface MappingBuilderContext.MappingResolver
Resolves the most suitable way for mapping an element (property, iterable element etc.) from source to target. There are 2 basic types of mappings:
  • conversions
  • methods
conversions are essentially one line mappings, such as String to Integer and Integer to Long methods come in some varieties:
  • referenced mapping methods, these are methods implemented (or referenced) by the user. Sometimes indicated with the 'uses' in the mapping annotations or part of the abstract mapper class
  • generated mapping methods (by means of MapStruct)
  • built in methods
Author:
Sjaak Derksen
  • Method Details

    • getTargetAssignment

      Assignment getTargetAssignment(Method mappingMethod, ForgedMethodHistory description, Type targetType, FormattingParameters formattingParameters, SelectionCriteria criteria, SourceRHS sourceRHS, AnnotationMirror positionHint, Supplier<Assignment> forger)
      returns a parameter assignment
      Parameters:
      mappingMethod - target mapping method
      description - the description source
      targetType - return type to match
      formattingParameters - used for formatting dates and numbers
      criteria - parameters criteria in the selection process
      sourceRHS - source information
      positionHint - the mirror for reporting problems
      forger - the supplier of the callback method to forge a method
      Returns:
      an assignment to a method parameter, which can either be:
      1. MethodReference
      2. TypeConversion
      3. SourceRHS Assignment (empty TargetAssignment)
      4. null, no assignment found
    • getUsedSupportedMappings

      Set<SupportingMappingMethod> getUsedSupportedMappings()
    • getUsedSupportedFields

      Set<Field> getUsedSupportedFields()