Interface Assignment
-
- All Known Implementing Classes:
AdderWrapper,ArrayCopyWrapper,AssignmentWrapper,EnumConstantWrapper,ExistingInstanceSetterWrapperForCollectionsAndMaps,GetterWrapperForCollectionsAndMaps,Java8FunctionWrapper,LifecycleCallbackMethodReference,LocalVarWrapper,MethodReference,NewInstanceSetterWrapperForCollectionsAndMaps,ReturnWrapper,SetterWrapper,SetterWrapperForCollectionsAndMaps,SetterWrapperForCollectionsAndMapsWithNullCheck,SourceRHS,StreamAdderWrapper,TypeConversion,UpdateWrapper,WrapperForCollectionsAndMaps
public interface AssignmentAssignment represents all kind of manners a source can be assigned to a target.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAssignment.AssignmentType
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringcreateUniqueVarName(java.lang.String desiredName)Creates an unique safe (local) variable name.java.util.Set<Type>getImportTypes()returns all types required as import by the assignment statement.java.lang.StringgetSourceLocalVarName()java.lang.StringgetSourceLoopVarName()SeegetSourceLoopVarName()(java.lang.String) }java.lang.StringgetSourceParameterName()Returns the source parameter name, to which this assignment applies.PresenceCheckgetSourcePresenceCheckerReference()the source presence checker referencejava.lang.StringgetSourceReference()the source reference being a source-getter, a constant, nested method call, etc.TypegetSourceType()the source type used in the matching processjava.util.List<Type>getThrownTypes()returns all types exception types thrown by this assignment.Assignment.AssignmentTypegetType()Returns whether the type of assignmentbooleanisCallingUpdateMethod()booleanisSourceReferenceParameter()voidsetAssignment(Assignment assignment)An assignment in itself can wrap another assignment.voidsetSourceLocalVarName(java.lang.String sourceLocalVarName)Replaces the sourceReference at the call site in the assignment in the template with this sourceLocalVarName.voidsetSourceLoopVarName(java.lang.String sourceLoopVarName)Replaces the sourceLocalVar or sourceReference at the call site in the assignment in the template with this sourceLoopVarName.
-
-
-
Method Detail
-
getImportTypes
java.util.Set<Type> getImportTypes()
returns all types required as import by the assignment statement.- Returns:
- imported types
-
getThrownTypes
java.util.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
java.lang.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
java.lang.String createUniqueVarName(java.lang.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
java.lang.String getSourceLocalVarName()
- Returns:
- local variable name (can be null if not set)
-
getSourceParameterName
java.lang.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(java.lang.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
java.lang.String getSourceLoopVarName()
SeegetSourceLoopVarName()(java.lang.String) }- Returns:
- loop variable (can be null if not set)
-
setSourceLoopVarName
void setSourceLoopVarName(java.lang.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
Assignment.AssignmentType getType()
Returns whether the type of assignment- Returns:
Assignment.AssignmentType
-
isCallingUpdateMethod
boolean isCallingUpdateMethod()
-
-