Package org.mapstruct.ap.internal.model
Class PropertyMapping.PropertyMappingBuilder
- java.lang.Object
-
- org.mapstruct.ap.internal.model.AbstractBaseBuilder<T>
-
- org.mapstruct.ap.internal.model.PropertyMapping.MappingBuilderBase<PropertyMapping.PropertyMappingBuilder>
-
- org.mapstruct.ap.internal.model.PropertyMapping.PropertyMappingBuilder
-
- Enclosing class:
- PropertyMapping
public static class PropertyMapping.PropertyMappingBuilder extends PropertyMapping.MappingBuilderBase<PropertyMapping.PropertyMappingBuilder>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringconditionJavaExpressionprivate java.lang.StringdefaultJavaExpressionprivate java.lang.StringdefaultValueprivate booleanforceUpdateMethodprivate booleanforgedNamedBasedprivate MappingReferencesforgeMethodWithMappingReferencesprivate FormattingParametersformattingParametersprivate MappingControlmappingControlprivate NullValueCheckStrategyGemnvcsprivate NullValuePropertyMappingStrategyGemnvpmsprivate SourceRHSrightHandSideprivate SelectionParametersselectionParametersprivate SourceReferencesourceReference-
Fields inherited from class org.mapstruct.ap.internal.model.PropertyMapping.MappingBuilderBase
dependsOn, existingVariableNames, positionHint, sourcePropertyName, targetBuilderType, targetPropertyName, targetReadAccessor, targetType, targetWriteAccessor, targetWriteAccessorType
-
Fields inherited from class org.mapstruct.ap.internal.model.AbstractBaseBuilder
ctx, method, myself
-
-
Constructor Summary
Constructors Constructor Description PropertyMappingBuilder()
-
Method Summary
-
Methods inherited from class org.mapstruct.ap.internal.model.PropertyMapping.MappingBuilderBase
dependsOn, existingVariableNames, isFieldAssignment, mirror, sourceMethod, sourcePropertyName, target
-
Methods inherited from class org.mapstruct.ap.internal.model.AbstractBaseBuilder
canGenerateAutoSubMappingBetween, createForgedAssignment, createForgedAssignment, mappingContext, method, reportCannotCreateMapping, reportCannotCreateMapping
-
-
-
-
Field Detail
-
defaultValue
private java.lang.String defaultValue
-
defaultJavaExpression
private java.lang.String defaultJavaExpression
-
conditionJavaExpression
private java.lang.String conditionJavaExpression
-
sourceReference
private SourceReference sourceReference
-
rightHandSide
private SourceRHS rightHandSide
-
formattingParameters
private FormattingParameters formattingParameters
-
selectionParameters
private SelectionParameters selectionParameters
-
mappingControl
private MappingControl mappingControl
-
forgeMethodWithMappingReferences
private MappingReferences forgeMethodWithMappingReferences
-
forceUpdateMethod
private boolean forceUpdateMethod
-
forgedNamedBased
private boolean forgedNamedBased
-
nvcs
private NullValueCheckStrategyGem nvcs
-
nvpms
private NullValuePropertyMappingStrategyGem nvpms
-
-
Method Detail
-
sourceReference
public PropertyMapping.PropertyMappingBuilder sourceReference(SourceReference sourceReference)
-
selectionParameters
public PropertyMapping.PropertyMappingBuilder selectionParameters(SelectionParameters selectionParameters)
-
formattingParameters
public PropertyMapping.PropertyMappingBuilder formattingParameters(FormattingParameters formattingParameters)
-
defaultValue
public PropertyMapping.PropertyMappingBuilder defaultValue(java.lang.String defaultValue)
-
defaultJavaExpression
public PropertyMapping.PropertyMappingBuilder defaultJavaExpression(java.lang.String defaultJavaExpression)
-
conditionJavaExpression
public PropertyMapping.PropertyMappingBuilder conditionJavaExpression(java.lang.String conditionJavaExpression)
-
forgeMethodWithMappingReferences
public PropertyMapping.PropertyMappingBuilder forgeMethodWithMappingReferences(MappingReferences mappingReferences)
-
forceUpdateMethod
public PropertyMapping.PropertyMappingBuilder forceUpdateMethod(boolean forceUpdateMethod)
Force the created mapping to use update methods when forging a method.- Parameters:
forceUpdateMethod- whether the mapping should force update method for forged mappings- Returns:
- the builder for chaining
-
forgedNamedBased
public PropertyMapping.PropertyMappingBuilder forgedNamedBased(boolean forgedNamedBased)
- Parameters:
forgedNamedBased- mapping is based on forging- Returns:
- the builder for chaining
-
options
public PropertyMapping.PropertyMappingBuilder options(DelegatingOptions options)
-
build
public PropertyMapping build()
-
forge
private Assignment forge()
-
reportCannotCreateMapping
private void reportCannotCreateMapping()
Report that a mapping could not be created.
-
getDefaultValueAssignment
private Assignment getDefaultValueAssignment(Assignment rhs)
-
assignToPlain
private Assignment assignToPlain(Type targetType, AccessorType targetAccessorType, Assignment rightHandSide)
-
assignToPlainViaSetter
private Assignment assignToPlainViaSetter(Type targetType, Assignment rhs)
-
setterWrapperNeedsSourceNullCheck
private boolean setterWrapperNeedsSourceNullCheck(Assignment rhs, Type targetType)
Checks whether the setter wrapper should include a null / presence check or not- Parameters:
rhs- the source right hand sidetargetType- the target type- Returns:
- whether to include a null / presence check or not
-
assignToPlainViaAdder
private Assignment assignToPlainViaAdder(Assignment rightHandSide)
-
assignToCollection
private Assignment assignToCollection(Type targetType, AccessorType targetAccessorType, Assignment rhs)
-
assignToArray
private Assignment assignToArray(Type targetType, Assignment rightHandSide)
-
getSourceRHS
private SourceRHS getSourceRHS(SourceReference sourceReference)
-
getSourcePresenceCheckerRef
private PresenceCheck getSourcePresenceCheckerRef(SourceReference sourceReference, SourceRHS sourceRHS)
-
forgeStreamMapping
private Assignment forgeStreamMapping(Type sourceType, Type targetType, SourceRHS source)
-
forgeIterableMapping
private Assignment forgeIterableMapping(Type sourceType, Type targetType, SourceRHS source)
-
forgeWithElementMapping
private Assignment forgeWithElementMapping(Type sourceType, Type targetType, SourceRHS source, ContainerMappingMethodBuilder<?,? extends ContainerMappingMethod> builder)
-
prepareForgedMethod
private ForgedMethod prepareForgedMethod(Type sourceType, Type targetType, SourceRHS source, java.lang.String suffix)
-
forgeMapMapping
private Assignment forgeMapMapping(Type sourceType, Type targetType, SourceRHS source)
-
forgeMapping
private Assignment forgeMapping(SourceRHS sourceRHS)
-
forgeMapping
private Assignment forgeMapping(Type sourceType, Type targetType, SourceRHS sourceRHS)
-
getForgedMethodHistory
private ForgedMethodHistory getForgedMethodHistory(SourceRHS sourceRHS)
-
getForgedMethodHistory
private ForgedMethodHistory getForgedMethodHistory(SourceRHS sourceRHS, java.lang.String suffix)
-
getName
private java.lang.String getName(Type type)
-
getSourceElementName
private java.lang.String getSourceElementName()
-
-