Interface AutomaticElementMappingRule


@OpenApiAll public interface AutomaticElementMappingRule
Rule for describing when source element can be mapped to target element without user input
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(TypedElement sourceElement)
    Gets if mapping rule can be applied to source element
    getElementToMap(Element sourceElement, List<Element> targetElements)
    Get target element to be automatically mapped to the source element.
    default boolean
    Allow one to one or many to one mapping.
  • Method Details

    • getElementToMap

      @CheckForNull Element getElementToMap(Element sourceElement, List<Element> targetElements)
      Get target element to be automatically mapped to the source element. If this method returns an element, provided elements will be mapped at once If this method returns null, user still can pair elements later manually
      Parameters:
      sourceElement - source element
      targetElements - list of candidate target elements. Target elements are always in the same nesting depth as the source element
      Returns:
      element that can be mapped automatically, without user input, to the source element
    • accept

      boolean accept(TypedElement sourceElement)
      Gets if mapping rule can be applied to source element
      Parameters:
      sourceElement - source element (property)
      Returns:
      true if rule can be used, else false
    • isOneToOneMapping

      default boolean isOneToOneMapping()
      Allow one to one or many to one mapping.
      Returns:
      true if only one to one mapping is allowed, false - many to one