Package org.mapstruct.ap.internal.model
Class MappingMethod
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.GeneratedTypeMethod
-
- org.mapstruct.ap.internal.model.MappingMethod
-
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
DelegatingMethod
,NestedPropertyMappingMethod
,NormalTypeMappingMethod
,SupportingMappingMethod
,ValueMappingMethod
public abstract class MappingMethod extends GeneratedTypeMethod
A method implemented or referenced by aMapper
class.- Author:
- Gunnar Morling
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MappingMethod(Method method)
protected
MappingMethod(Method method, Collection<String> existingVariableNames, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
constructor to be overloaded when local variable names are required prior to calling this constructor.protected
MappingMethod(Method method, List<Parameter> parameters)
protected
MappingMethod(Method method, List<Parameter> parameters, Collection<String> existingVariableNames, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
protected
MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
-
Method Summary
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Constructor Detail
-
MappingMethod
protected MappingMethod(Method method, Collection<String> existingVariableNames, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
constructor to be overloaded when local variable names are required prior to calling this constructor. (e.g. for property mappings). It is supposed to be initialized with at least the parameter names.- Parameters:
method
- the method for which this mapping is applicableexistingVariableNames
- set of already assigned variable namesbeforeMappingReferences
- all life cycle methods to be called prior to carrying out mappingafterMappingReferences
- all life cycle methods to be called after carrying out mapping
-
MappingMethod
protected MappingMethod(Method method, List<Parameter> parameters, Collection<String> existingVariableNames, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
-
MappingMethod
protected MappingMethod(Method method)
-
MappingMethod
protected MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
-
-
Method Detail
-
getName
public String getName()
-
getResultType
public Type getResultType()
-
getResultName
public String getResultName()
-
getReturnType
public Type getReturnType()
-
getAccessibility
public Accessibility getAccessibility()
-
isExistingInstanceMapping
public boolean isExistingInstanceMapping()
-
isStatic
public boolean isStatic()
-
getImportTypes
public Set<Type> getImportTypes()
Description copied from class:ModelElement
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypes
in classModelElement
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
filterMappingTarget
protected static List<LifecycleCallbackMethodReference> filterMappingTarget(List<LifecycleCallbackMethodReference> methods, boolean mustHaveMappingTargetParameter)
-
getAfterMappingReferences
public List<LifecycleCallbackMethodReference> getAfterMappingReferences()
-
getBeforeMappingReferencesWithMappingTarget
public List<LifecycleCallbackMethodReference> getBeforeMappingReferencesWithMappingTarget()
-
getBeforeMappingReferencesWithoutMappingTarget
public List<LifecycleCallbackMethodReference> getBeforeMappingReferencesWithoutMappingTarget()
-
-