Class LifecycleMethodResolver

    • Constructor Detail

      • LifecycleMethodResolver

        private LifecycleMethodResolver()
    • Method Detail

      • beforeMappingMethods

        public static java.util.List<LifecycleCallbackMethodReference> beforeMappingMethods​(Method method,
                                                                                            Type alternativeTarget,
                                                                                            SelectionParameters selectionParameters,
                                                                                            MappingBuilderContext ctx,
                                                                                            java.util.Set<java.lang.String> existingVariableNames)
        Parameters:
        method - the method to obtain the beforeMapping methods for
        alternativeTarget - alternative to Method.getResultType() e.g. when target is abstract
        selectionParameters - method selectionParameters
        ctx - the builder context
        existingVariableNames - the existing variable names in the mapping method
        Returns:
        all applicable @BeforeMapping methods for the given method
      • afterMappingMethods

        public static java.util.List<LifecycleCallbackMethodReference> afterMappingMethods​(Method method,
                                                                                           Type alternativeTarget,
                                                                                           SelectionParameters selectionParameters,
                                                                                           MappingBuilderContext ctx,
                                                                                           java.util.Set<java.lang.String> existingVariableNames)
        Parameters:
        method - the method to obtain the afterMapping methods for
        alternativeTarget - alternative to Method.getResultType() e.g. when target is abstract
        selectionParameters - method selectionParameters
        ctx - the builder context
        existingVariableNames - list of already used variable names
        Returns:
        all applicable @AfterMapping methods for the given method
      • beforeMappingMethods

        public static java.util.List<LifecycleCallbackMethodReference> beforeMappingMethods​(Method method,
                                                                                            SelectionParameters selectionParameters,
                                                                                            MappingBuilderContext ctx,
                                                                                            java.util.Set<java.lang.String> existingVariableNames)
        Parameters:
        method - the method to obtain the beforeMapping methods for
        selectionParameters - method selectionParameters
        ctx - the builder context
        existingVariableNames - the existing variable names in the mapping method
        Returns:
        all applicable @BeforeMapping methods for the given method
      • afterMappingMethods

        public static java.util.List<LifecycleCallbackMethodReference> afterMappingMethods​(Method method,
                                                                                           SelectionParameters selectionParameters,
                                                                                           MappingBuilderContext ctx,
                                                                                           java.util.Set<java.lang.String> existingVariableNames)
        Parameters:
        method - the method to obtain the afterMapping methods for
        selectionParameters - method selectionParameters
        ctx - the builder context
        existingVariableNames - list of already used variable names
        Returns:
        all applicable @AfterMapping methods for the given method
      • getAllAvailableMethods

        private static java.util.List<SourceMethod> getAllAvailableMethods​(Method method,
                                                                           java.util.List<SourceMethod> sourceModelMethods)
      • filterBeforeMappingMethods

        private static java.util.List<SourceMethod> filterBeforeMappingMethods​(java.util.List<SourceMethod> methods)
      • filterAfterMappingMethods

        private static java.util.List<SourceMethod> filterAfterMappingMethods​(java.util.List<SourceMethod> methods)