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
A method implemented or referenced by a
Mapper class.- Author:
- Gunnar Morling
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMappingMethod(Method method) protectedMappingMethod(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.protectedMappingMethod(Method method, List<Parameter> parameters) protectedMappingMethod(Method method, List<Parameter> parameters, Collection<String> existingVariableNames, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences) protectedMappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected static List<LifecycleCallbackMethodReference> filterMappingTarget(List<LifecycleCallbackMethodReference> methods, boolean mustHaveMappingTargetParameter) Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.getName()inthashCode()booleanbooleanisStatic()toString()Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
Constructor Details
-
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
-
MappingMethod
-
MappingMethod
protected MappingMethod(Method method, List<LifecycleCallbackMethodReference> beforeMappingReferences, List<LifecycleCallbackMethodReference> afterMappingReferences)
-
-
Method Details
-
getName
-
getParameters
-
getSourceParameters
-
getResultType
-
getResultName
-
getReturnType
-
getAccessibility
-
isExistingInstanceMapping
public boolean isExistingInstanceMapping() -
isStatic
public boolean isStatic() -
getImportTypes
Description copied from class:ModelElementReturns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypesin classModelElement- Returns:
- A set with type referenced by this model element. Must not be
null.
-
getParameterNames
-
getThrownTypes
-
toString
-
filterMappingTarget
protected static List<LifecycleCallbackMethodReference> filterMappingTarget(List<LifecycleCallbackMethodReference> methods, boolean mustHaveMappingTargetParameter) -
getAfterMappingReferences
-
getBeforeMappingReferencesWithMappingTarget
-
getBeforeMappingReferencesWithoutMappingTarget
-
hashCode
public int hashCode() -
equals
-