Package org.mapstruct.ap.internal.model
Class ObjectFactoryMethodResolver
java.lang.Object
org.mapstruct.ap.internal.model.ObjectFactoryMethodResolver
Factory for creating the appropriate object factory method.
- Author:
- Sjaak Derksen
-
Method Summary
Modifier and TypeMethodDescriptionstatic MethodReferencegetBuilderFactoryMethod(Type typeToBuild, BuilderType builder) static MethodReferencegetBuilderFactoryMethod(Method method, BuilderType builder) static MethodReferencegetFactoryMethod(Method method, Type alternativeTarget, SelectionParameters selectionParameters, MappingBuilderContext ctx) returns a no arg factory methodstatic MethodReferencegetFactoryMethod(Method method, SelectionParameters selectionParameters, MappingBuilderContext ctx) returns a no arg factory methodstatic MethodReferencegetFactoryMethodReference(Method method, SelectedMethod<SourceMethod> matchingFactoryMethod, MappingBuilderContext ctx) static List<SelectedMethod<SourceMethod>> getMatchingFactoryMethods(Method method, Type alternativeTarget, SelectionParameters selectionParameters, MappingBuilderContext ctx)
-
Method Details
-
getFactoryMethod
public static MethodReference getFactoryMethod(Method method, SelectionParameters selectionParameters, MappingBuilderContext ctx) returns a no arg factory method- Parameters:
method- target mapping methodselectionParameters- parameters used in the selection processctx- the mapping builder context- Returns:
- a method reference to the factory method, or null if no suitable, or ambiguous method found
-
getFactoryMethod
public static MethodReference getFactoryMethod(Method method, Type alternativeTarget, SelectionParameters selectionParameters, MappingBuilderContext ctx) returns a no arg factory method- Parameters:
method- target mapping methodalternativeTarget- alternative toMethod.getResultType()e.g. when target is abstractselectionParameters- parameters used in the selection processctx- the mapping builder context- Returns:
- a method reference to the factory method, or null if no suitable, or ambiguous method found
-
getFactoryMethodReference
public static MethodReference getFactoryMethodReference(Method method, SelectedMethod<SourceMethod> matchingFactoryMethod, MappingBuilderContext ctx) -
getMatchingFactoryMethods
public static List<SelectedMethod<SourceMethod>> getMatchingFactoryMethods(Method method, Type alternativeTarget, SelectionParameters selectionParameters, MappingBuilderContext ctx) -
getBuilderFactoryMethod
-
getBuilderFactoryMethod
-