Class TargetReference.Builder

    • Field Detail

      • method

        private Method method
      • targetProperties

        private java.util.Set<java.lang.String> targetProperties
      • targetType

        private Type targetType
      • targetName

        private java.lang.String targetName
      • annotationMirror

        private javax.lang.model.element.AnnotationMirror annotationMirror
      • targetAnnotationValue

        private javax.lang.model.element.AnnotationValue targetAnnotationValue
      • sourceAnnotationValue

        private javax.lang.model.element.AnnotationValue sourceAnnotationValue
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • targetProperties

        public TargetReference.Builder targetProperties​(java.util.Set<java.lang.String> targetProperties)
      • matchesSourceOrTargetParameter

        private boolean matchesSourceOrTargetParameter​(java.lang.String segment,
                                                       Parameter targetParameter)
        Validates that the segment is the same as the targetParameter or the inverseSourceParameter names
        Parameters:
        segment - that needs to be checked
        targetParameter - the target parameter if it exists
        Returns:
        true if the segment matches the name of the targetParameter or the name of the inverseSourceParameter when this is a inverse TargetReference is being built, false otherwise
      • matchesSourceOnInverseSourceParameter

        private boolean matchesSourceOnInverseSourceParameter​(java.lang.String segment)
        Needed when we are building from inverse mapping. It is needed, so we can remove the first level if it is needed. E.g. If we have a mapping like: @Mapping( target = "letterSignature", source = "dto.signature" ) When it is inversed it will look like: @Mapping( target = "dto.signature", source = "letterSignature" ) The dto needs to be considered as a possibility for a target name only if a Target Reference for a inverse is created.
        Parameters:
        segment - that needs to be checked*
        Returns:
        on match when inverse and segment matches the one and only source parameter