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.MappingMethod
-
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
DelegatingMethod
,NestedPropertyMappingMethod
,NormalTypeMappingMethod
,SupportingMappingMethod
,ValueMappingMethod
public abstract class MappingMethod extends ModelElement
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Accessibility
getAccessibility()
List<LifecycleCallbackMethodReference>
getAfterMappingReferences()
List<LifecycleCallbackMethodReference>
getBeforeMappingReferencesWithMappingTarget()
List<LifecycleCallbackMethodReference>
getBeforeMappingReferencesWithoutMappingTarget()
Set<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.String
getName()
protected List<String>
getParameterNames()
List<Parameter>
getParameters()
String
getResultName()
Type
getResultType()
Type
getReturnType()
List<Parameter>
getSourceParameters()
List<Type>
getThrownTypes()
int
hashCode()
boolean
isExistingInstanceMapping()
boolean
isStatic()
String
toString()
-
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
.
-
getAfterMappingReferences
public List<LifecycleCallbackMethodReference> getAfterMappingReferences()
-
getBeforeMappingReferencesWithMappingTarget
public List<LifecycleCallbackMethodReference> getBeforeMappingReferencesWithMappingTarget()
-
getBeforeMappingReferencesWithoutMappingTarget
public List<LifecycleCallbackMethodReference> getBeforeMappingReferencesWithoutMappingTarget()
-
-