public class SetterWrapper extends AssignmentWrapper
Assignment.AssignmentType
Writable.Context
fieldAssignment
Constructor and Description |
---|
SetterWrapper(Assignment rhs,
List<Type> thrownTypesToExclude,
boolean fieldAssignment) |
SetterWrapper(Assignment rhs,
List<Type> thrownTypesToExclude,
boolean fieldAssignment,
boolean includeSourceNullCheck,
boolean setExplicitlyToNull,
boolean setExplicitlyToDefault) |
Modifier and Type | Method and Description |
---|---|
static boolean |
doSourceNullCheck(Assignment rhs,
org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs,
org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms,
Type targetType)
Wraps the assignment in a target setter. include a null check when
- Not if source is the parameter iso property, because the null check is than handled by the bean mapping
- Not when source is primitive, you can't null check a primitive
- The source property is fed to a conversion somehow before its assigned to the target
- The user decided to ALLWAYS include a null check
|
List<Type> |
getThrownTypes()
returns all types exception types thrown by this assignment.
|
boolean |
isIncludeSourceNullCheck() |
boolean |
isSetExplicitlyToDefault() |
boolean |
isSetExplicitlyToNull() |
createUniqueVarName, getAssignment, getImportTypes, getSourceLocalVarName, getSourceLoopVarName, getSourceParameterName, getSourcePresenceCheckerReference, getSourceReference, getSourceType, getType, isCallingUpdateMethod, isFieldAssignment, isSourceReferenceParameter, setAssignment, setSourceLocalVarName, setSourceLoopVarName
getTemplateName, getTemplateNameForClass, write
public SetterWrapper(Assignment rhs, List<Type> thrownTypesToExclude, boolean fieldAssignment, boolean includeSourceNullCheck, boolean setExplicitlyToNull, boolean setExplicitlyToDefault)
public SetterWrapper(Assignment rhs, List<Type> thrownTypesToExclude, boolean fieldAssignment)
public List<Type> getThrownTypes()
Assignment
getThrownTypes
in interface Assignment
getThrownTypes
in class AssignmentWrapper
public boolean isSetExplicitlyToNull()
public boolean isSetExplicitlyToDefault()
public boolean isIncludeSourceNullCheck()
public static boolean doSourceNullCheck(Assignment rhs, org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs, org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms, Type targetType)
rhs
- the source righthand sidenvcs
- null value check strategynvpms
- null value property mapping strategytargetType
- the target typeCopyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.