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
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.AssignmentTypeNested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context -
Method Summary
Modifier and TypeMethodDescriptionforMethodReference(SelectedMethod<SourceMethod> lifecycleMethod, MapperReference mapperReference, Method containingMethod, Set<String> existingVariableNames) forParameterProvidedMethod(SelectedMethod<SourceMethod> lifecycleMethod, Parameter providingParameter, Method containingMethod, Set<String> existingVariableNames) Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.Returns the result type of the mapping method in which this callback method is calledReturns the return type of the mapping method in which this callback method is calledbooleanbooleanMethods 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, toStringMethods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
Method Details
-
getDeclaringType
-
getMethodReturnType
Returns the return type of the mapping method in which this callback method is called- Returns:
- return type
- See Also:
-
getMethodResultType
Returns the result type of the mapping method in which this callback method is called- Returns:
- result type
- See Also:
-
getTargetVariableName
-
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 interfaceAssignment- Overrides:
getImportTypesin 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)
-