Class 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
  • Method Details

    • 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:
    • getMethodResultType

      public Type getMethodResultType()
      Returns the result type of the mapping method in which this callback method is called
      Returns:
      result type
      See Also:
    • getTargetVariableName

      public String getTargetVariableName()
    • getImportTypes

      public Set<Type> getImportTypes()
      Description copied from class: ModelElement
      Returns a set containing those Types referenced by this model element for which an import statement needs to be declared.
      Specified by:
      getImportTypes in interface Assignment
      Overrides:
      getImportTypes in class MethodReference
      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)