Interface Assignment

All Known Implementing Classes:
AdderWrapper, ArrayCopyWrapper, AssignmentWrapper, EnumConstantWrapper, ExistingInstanceSetterWrapperForCollectionsAndMaps, FromOptionalTypeConversion, GetterWrapperForCollectionsAndMaps, Java8FunctionWrapper, LifecycleCallbackMethodReference, LocalVarWrapper, MethodReference, NewInstanceSetterWrapperForCollectionsAndMaps, OptionalGetWrapper, ReturnWrapper, SetterWrapper, SetterWrapperForCollectionsAndMaps, SetterWrapperForCollectionsAndMapsWithNullCheck, SourceRHS, StreamAdderWrapper, ToOptionalTypeConversion, TypeConversion, UpdateWrapper, WrapperForCollectionsAndMaps

public interface Assignment
Assignment represents all kind of manners a source can be assigned to a target.
Author:
Sjaak Derksen
  • Method Details

    • getImportTypes

      Set<Type> getImportTypes()
      returns all types required as import by the assignment statement.
      Returns:
      imported types
    • getThrownTypes

      List<Type> getThrownTypes()
      returns all types exception types thrown by this assignment.
      Returns:
      exceptions thrown
    • setAssignment

      void setAssignment(Assignment assignment)
      An assignment in itself can wrap another assignment. E.g.:
      • a MethodReference can wrap a TypeConversion, another MethodReference and ultimately a Simple
      • a TypeConversion can wrap a MethodReference, and ultimately a Simple
      Parameters:
      assignment - the assignment to set
    • getSourceReference

      String getSourceReference()
      the source reference being a source-getter, a constant, nested method call, etc.
      Returns:
      source reference
    • isSourceReferenceParameter

      boolean isSourceReferenceParameter()
      Returns:
      true when the source reference is the source parameter (and not a property of the source parameter type)
    • getSourcePresenceCheckerReference

      PresenceCheck getSourcePresenceCheckerReference()
      the source presence checker reference
      Returns:
      source reference
    • getSourceType

      Type getSourceType()
      the source type used in the matching process
      Returns:
      source type (can be null)
    • createUniqueVarName

      String createUniqueVarName(String desiredName)
      Creates an unique safe (local) variable name.
      Parameters:
      desiredName - the desired name
      Returns:
      the desired name, made unique in the scope of the bean mapping.
    • getSourceLocalVarName

      String getSourceLocalVarName()
      Returns:
      local variable name (can be null if not set)
    • getSourceParameterName

      String getSourceParameterName()
      Returns the source parameter name, to which this assignment applies. Note: the source parameter itself might be mapped by this assignment, or one of its properties
      Returns:
      the source parameter name
    • setSourceLocalVarName

      void setSourceLocalVarName(String sourceLocalVarName)
      Replaces the sourceReference at the call site in the assignment in the template with this sourceLocalVarName. The sourceLocalVarName can subsequently be used for e.g. null checking.
      Parameters:
      sourceLocalVarName - source local variable name
    • getSourceLoopVarName

      String getSourceLoopVarName()
      See getSourceLoopVarName() (java.lang.String) }
      Returns:
      loop variable (can be null if not set)
    • setSourceLoopVarName

      void setSourceLoopVarName(String sourceLoopVarName)
      Replaces the sourceLocalVar or sourceReference at the call site in the assignment in the template with this sourceLoopVarName. The sourceLocalVar can subsequently be used for e.g. null checking.
      Parameters:
      sourceLoopVarName - loop variable
    • getType

      Returns whether the type of assignment
      Returns:
      Assignment.AssignmentType
    • isCallingUpdateMethod

      boolean isCallingUpdateMethod()