Class TargetReference


  • public class TargetReference
    extends java.lang.Object
    This class describes the target side of a property mapping.

    It contains the target parameter, and all individual (nested) property entries. So consider the following mapping method:

     @Mapping(target = "propC", source = "in.propA.propB")
     TypeB mappingMethod(TypeA in);
     
    Then:
    • parameter will describe in
    • propertyEntries[0] will describe propA
    • propertyEntries[1] will describe propB
    • Field Detail

      • pathProperties

        private final java.util.List<java.lang.String> pathProperties
      • parameter

        private final Parameter parameter
      • propertyEntries

        private final java.util.List<java.lang.String> propertyEntries
    • Constructor Detail

      • TargetReference

        public TargetReference​(Parameter parameter,
                               java.util.List<java.lang.String> propertyEntries)
      • TargetReference

        public TargetReference​(Parameter parameter,
                               java.util.List<java.lang.String> propertyEntries,
                               java.util.List<java.lang.String> pathProperties)
    • Method Detail

      • getPathProperties

        public java.util.List<java.lang.String> getPathProperties()
      • getPropertyEntries

        public java.util.List<java.lang.String> getPropertyEntries()
      • getElementNames

        public java.util.List<java.lang.String> getElementNames()
      • getShallowestPropertyName

        public java.lang.String getShallowestPropertyName()
        Returns:
        the property name on the shallowest nesting level
      • isNested

        public boolean isNested()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object