Class SourceReference.BuilderFromMapping

  • Enclosing class:
    SourceReference

    public static class SourceReference.BuilderFromMapping
    extends java.lang.Object
    Builds a SourceReference from an @Mappping.
    • Field Detail

      • method

        private Method method
      • isForwarded

        private boolean isForwarded
      • templateMethod

        private Method templateMethod
      • sourceName

        private java.lang.String sourceName
      • annotationMirror

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

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

      • BuilderFromMapping

        public BuilderFromMapping()
    • Method Detail

      • buildFromSingleSourceParameters

        private SourceReference buildFromSingleSourceParameters​(java.lang.String[] segments,
                                                                Parameter parameter)
        When there is only one source parameters, the first segment name of the property may, or may not match the parameter name to avoid ambiguity consider: Target map( Source1 source1 ) entries in a @Mapping#source can be "source1.propx" or just "propx" to be valid
        Parameters:
        segments - the segments of @Mapping#source
        parameter - the one and only parameter
        Returns:
        the source reference
      • buildFromMultipleSourceParameters

        private SourceReference buildFromMultipleSourceParameters​(java.lang.String[] segments,
                                                                  Parameter parameter)
        When there are more than one source parameters, the first segment name of the property needs to match the parameter name to avoid ambiguity
        Parameters:
        segments - the segments of @Mapping#source
        parameter - the relevant source parameter
        Returns:
        the source reference
      • fetchMatchingParameterFromFirstSegment

        private Parameter fetchMatchingParameterFromFirstSegment​(java.lang.String[] segments)
        When there are more than one source parameters, the first segment name of the property needs to match the parameter name to avoid ambiguity consider: Target map( Source1 source1, Source2 source2 ) entries in a @Mapping#source need to be "source1.propx" or "source2.propy.propz" to be valid
        Parameters:
        segments - the segments of @Mapping#source
        Returns:
        parameter that matches with first segment of @Mapping#source
      • getSourceParameterFromMethodOrTemplate

        private Parameter getSourceParameterFromMethodOrTemplate​(java.lang.String parameterName)
      • reportErrorOnNoMatch

        private void reportErrorOnNoMatch​(Parameter parameter,
                                          java.lang.String[] propertyNames,
                                          java.util.List<PropertyEntry> entries)
      • matchWithSourceAccessorTypes

        private java.util.List<PropertyEntry> matchWithSourceAccessorTypes​(Type type,
                                                                           java.lang.String[] entryNames)
      • reportMappingError

        private void reportMappingError​(Message msg,
                                        java.lang.Object... objects)