Package org.mapstruct.ap.internal.model
Class LifecycleMethodResolver
- java.lang.Object
-
- org.mapstruct.ap.internal.model.LifecycleMethodResolver
-
public final class LifecycleMethodResolver extends java.lang.ObjectFactory for creating lists of appropriateLifecycleCallbackMethodReferences
-
-
Constructor Summary
Constructors Modifier Constructor Description privateLifecycleMethodResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<LifecycleCallbackMethodReference>afterMappingMethods(Method method, Type alternativeTarget, SelectionParameters selectionParameters, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)static java.util.List<LifecycleCallbackMethodReference>afterMappingMethods(Method method, SelectionParameters selectionParameters, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)static java.util.List<LifecycleCallbackMethodReference>beforeMappingMethods(Method method, Type alternativeTarget, SelectionParameters selectionParameters, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)static java.util.List<LifecycleCallbackMethodReference>beforeMappingMethods(Method method, SelectionParameters selectionParameters, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)private static java.util.List<LifecycleCallbackMethodReference>collectLifecycleCallbackMethods(Method method, Type targetType, SelectionParameters selectionParameters, java.util.List<SourceMethod> callbackMethods, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)private static java.util.List<SourceMethod>filterAfterMappingMethods(java.util.List<SourceMethod> methods)private static java.util.List<SourceMethod>filterBeforeMappingMethods(java.util.List<SourceMethod> methods)private static java.util.List<SourceMethod>getAllAvailableMethods(Method method, java.util.List<SourceMethod> sourceModelMethods)private static java.util.List<LifecycleCallbackMethodReference>toLifecycleCallbackMethodRefs(Method method, java.util.List<SelectedMethod<SourceMethod>> candidates, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)
-
-
-
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 foralternativeTarget- alternative toMethod.getResultType()e.g. when target is abstractselectionParameters- method selectionParametersctx- the builder contextexistingVariableNames- the existing variable names in the mapping method- Returns:
- all applicable
@BeforeMappingmethods 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 foralternativeTarget- alternative toMethod.getResultType()e.g. when target is abstractselectionParameters- method selectionParametersctx- the builder contextexistingVariableNames- list of already used variable names- Returns:
- all applicable
@AfterMappingmethods 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 forselectionParameters- method selectionParametersctx- the builder contextexistingVariableNames- the existing variable names in the mapping method- Returns:
- all applicable
@BeforeMappingmethods 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 forselectionParameters- method selectionParametersctx- the builder contextexistingVariableNames- list of already used variable names- Returns:
- all applicable
@AfterMappingmethods for the given method
-
getAllAvailableMethods
private static java.util.List<SourceMethod> getAllAvailableMethods(Method method, java.util.List<SourceMethod> sourceModelMethods)
-
collectLifecycleCallbackMethods
private static java.util.List<LifecycleCallbackMethodReference> collectLifecycleCallbackMethods(Method method, Type targetType, SelectionParameters selectionParameters, java.util.List<SourceMethod> callbackMethods, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)
-
toLifecycleCallbackMethodRefs
private static java.util.List<LifecycleCallbackMethodReference> toLifecycleCallbackMethodRefs(Method method, java.util.List<SelectedMethod<SourceMethod>> candidates, MappingBuilderContext ctx, java.util.Set<java.lang.String> existingVariableNames)
-
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)
-
-