Package org.mapstruct.ap.internal.model
Class LifecycleCallbackMethodReference
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.MethodReference
-
- org.mapstruct.ap.internal.model.LifecycleCallbackMethodReference
-
- All Implemented Interfaces:
Assignment
,Writable
public class LifecycleCallbackMethodReference extends MethodReference
Represents a reference to a method that is annotated with@BeforeMapping
or@AfterMapping
.- Author:
- Andreas Gudian
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.model.common.Assignment
Assignment.AssignmentType
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LifecycleCallbackMethodReference
forMethodReference(SelectedMethod<SourceMethod> lifecycleMethod, MapperReference mapperReference, Method containingMethod, Set<String> existingVariableNames)
static LifecycleCallbackMethodReference
forParameterProvidedMethod(SelectedMethod<SourceMethod> lifecycleMethod, Parameter providingParameter, Method containingMethod, Set<String> existingVariableNames)
Type
getDeclaringType()
Set<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.Type
getMethodResultType()
Returns the result type of the mapping method in which this callback method is calledType
getMethodReturnType()
Returns the return type of the mapping method in which this callback method is calledString
getTargetVariableName()
boolean
hasMappingTargetParameter()
boolean
hasReturnType()
-
Methods inherited from class org.mapstruct.ap.internal.model.MethodReference
createUniqueVarName, equals, forBuiltInMethod, forConstructorInvocation, forForgedMethod, forMapperReference, forMethodCall, forMethodChaining, forParameterProvidedMethod, forStaticBuilder, getAssignment, getContextParam, getDeclaringMapper, getDefiningType, getMapperVariableName, getMethodsToChain, getName, getParameterBindings, getProvidingParameter, getReturnType, getSingleSourceParameterType, getSourceLocalVarName, getSourceLoopVarName, getSourceParameterName, getSourceParameters, getSourcePresenceCheckerReference, getSourceReference, getSourceType, getThrownTypes, getType, hashCode, inferTypeWhenEnum, isCallingUpdateMethod, isConstructor, isMethodChaining, isSourceReferenceParameter, isStatic, setAssignment, setSourceLocalVarName, setSourceLoopVarName, toString
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Method Detail
-
getDeclaringType
public Type getDeclaringType()
-
getMethodReturnType
public Type getMethodReturnType()
Returns the return type of the mapping method in which this callback method is called- Returns:
- return type
- See Also:
Method.getReturnType()
-
getMethodResultType
public Type getMethodResultType()
Returns the result type of the mapping method in which this callback method is called- Returns:
- result type
- See Also:
Method.getResultType()
-
getTargetVariableName
public String getTargetVariableName()
-
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 interfaceAssignment
- Overrides:
getImportTypes
in classMethodReference
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
hasMappingTargetParameter
public boolean hasMappingTargetParameter()
-
hasReturnType
public boolean hasReturnType()
- Returns:
- true if this callback method has a return type that is not void
-
forParameterProvidedMethod
public static LifecycleCallbackMethodReference forParameterProvidedMethod(SelectedMethod<SourceMethod> lifecycleMethod, Parameter providingParameter, Method containingMethod, Set<String> existingVariableNames)
-
forMethodReference
public static LifecycleCallbackMethodReference forMethodReference(SelectedMethod<SourceMethod> lifecycleMethod, MapperReference mapperReference, Method containingMethod, Set<String> existingVariableNames)
-
-