Class MappingMethodOptions


  • public class MappingMethodOptions
    extends java.lang.Object
    Encapsulates all options specifiable on a mapping method
    • Method Detail

      • empty

        public static MappingMethodOptions empty()
        creates empty mapping options
        Returns:
        empty mapping options
      • getMappings

        public java.util.Set<MappingOptions> getMappings()
        Returns:
        the MappingOptionss configured for this method, keyed by target property name. Only for enum mapping methods a target will be mapped by several sources.
      • setEnumMappingOptions

        public void setEnumMappingOptions​(EnumMappingOptions enumMappingOptions)
      • setValueMappings

        public void setValueMappings​(java.util.List<ValueMappingOptions> valueMappings)
      • isFullyInitialized

        public boolean isFullyInitialized()
        Returns:
        the true, iff the options have been fully initialized by applying all available inheritance options
      • markAsFullyInitialized

        public void markAsFullyInitialized()
      • applyInheritedOptions

        public void applyInheritedOptions​(SourceMethod sourceMethod,
                                          SourceMethod templateMethod,
                                          boolean isInverse,
                                          javax.lang.model.element.AnnotationMirror annotationMirror)
        Merges in all the mapping options configured, giving the already defined options precedence.
        Parameters:
        sourceMethod - the method which inherits the options.
        templateMethod - the template method with the options to inherit, may be null
        isInverse - if true, the specified options are from an inverse method
        annotationMirror - the annotation on which the compile errors will be shown.
      • addAllNonRedefined

        private void addAllNonRedefined​(SourceMethod sourceMethod,
                                        javax.lang.model.element.AnnotationMirror annotationMirror,
                                        java.util.List<SubclassMappingOptions> inheritedMappings)
      • addAllNonRedefined

        private void addAllNonRedefined​(java.util.Set<MappingOptions> inheritedMappings)
      • isRedefined

        private boolean isRedefined​(java.util.Set<java.lang.String> redefinedNames,
                                    java.lang.String inheritedName)
      • elementsAreContainedIn

        private boolean elementsAreContainedIn​(java.lang.String redefinedName,
                                               java.lang.String inheritedName)
      • filterNestedTargetIgnores

        private void filterNestedTargetIgnores​(java.util.Set<MappingOptions> mappings)
      • isToBeIgnored

        private boolean isToBeIgnored​(java.util.Set<java.lang.String> ignored,
                                      MappingOptions mapping)
      • getPropertyEntries

        private java.lang.String[] getPropertyEntries​(MappingOptions mapping)
      • getFirstTargetPropertyName

        private java.lang.String getFirstTargetPropertyName​(MappingOptions mapping)
      • getForgedMethodInheritedOptions

        public static MappingMethodOptions getForgedMethodInheritedOptions​(MappingMethodOptions options)
        SubclassMappingOptions are not inherited to forged methods. They would result in an infinite loop if they were.
        Returns:
        a MappingMethodOptions without SubclassMappingOptions or SubclassValidator.