Package org.mapstruct.ap.internal.model
Class AbstractBaseBuilder<B extends AbstractBaseBuilder<B>>
- java.lang.Object
-
- org.mapstruct.ap.internal.model.AbstractBaseBuilder<B>
-
- Direct Known Subclasses:
AbstractMappingMethodBuilder,PropertyMapping.MappingBuilderBase
class AbstractBaseBuilder<B extends AbstractBaseBuilder<B>> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AbstractBaseBuilder(java.lang.Class<B> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleancanGenerateAutoSubMappingBetween(Type sourceType, Type targetType)Checks if MapStruct is allowed to generate an automatic sub-mapping betweensourceTypeand @{code targetType}.private AssignmentcreateAssignment(SourceRHS source, ForgedMethod methodRef)(package private) AssignmentcreateForgedAssignment(SourceRHS sourceRHS, BuilderType builderType, ForgedMethod forgedMethod)Creates a forged assignment from the providedsourceRHSandforgedMethod.(package private) AssignmentcreateForgedAssignment(SourceRHS source, ForgedMethod methodRef, MappingMethod mappingMethod)private booleanisDisableSubMappingMethodsGeneration()BmappingContext(MappingBuilderContext mappingContext)Bmethod(Method sourceMethod)(package private) voidreportCannotCreateMapping(Method method, java.lang.String sourceErrorMessagePart, Type sourceType, Type targetType, java.lang.String targetPropertyName)Reports that a mapping could not be created.(package private) voidreportCannotCreateMapping(Method method, javax.lang.model.element.AnnotationMirror posHint, java.lang.String sourceErrorMessagePart, Type sourceType, Type targetType, java.lang.String targetPropertyName)Reports that a mapping could not be created.
-
-
-
Field Detail
-
myself
protected B extends AbstractBaseBuilder<B> myself
-
ctx
protected MappingBuilderContext ctx
-
method
protected Method method
-
-
Constructor Detail
-
AbstractBaseBuilder
AbstractBaseBuilder(java.lang.Class<B> selfType)
-
-
Method Detail
-
mappingContext
public B mappingContext(MappingBuilderContext mappingContext)
-
canGenerateAutoSubMappingBetween
boolean canGenerateAutoSubMappingBetween(Type sourceType, Type targetType)
Checks if MapStruct is allowed to generate an automatic sub-mapping betweensourceTypeand @{code targetType}. This will evaluate totrue, when:- Automatic sub-mapping methods generation is not disabled
- MapStruct is allowed to generate an automatic sub-mapping between the
sourceTypeandtargetType- Parameters:
sourceType- candidate source type to generate a sub-mapping fromtargetType- candidate target type to generate a sub-mapping for- Returns:
trueif MapStruct can try to generate an automatic sub-mapping between the types.
-
isDisableSubMappingMethodsGeneration
private boolean isDisableSubMappingMethodsGeneration()
-
createForgedAssignment
Assignment createForgedAssignment(SourceRHS sourceRHS, BuilderType builderType, ForgedMethod forgedMethod)
Creates a forged assignment from the providedsourceRHSandforgedMethod. If a mapping method for theforgedMethodalready exists, then this method used for the assignment.- Parameters:
sourceRHS- that needs to be used for the assignmentforgedMethod- the forged method for which we want to create anAssignment- Returns:
- See above
-
createForgedAssignment
Assignment createForgedAssignment(SourceRHS source, ForgedMethod methodRef, MappingMethod mappingMethod)
-
createAssignment
private Assignment createAssignment(SourceRHS source, ForgedMethod methodRef)
-
reportCannotCreateMapping
void reportCannotCreateMapping(Method method, java.lang.String sourceErrorMessagePart, Type sourceType, Type targetType, java.lang.String targetPropertyName)
Reports that a mapping could not be created.- Parameters:
method- the method that should be mappedsourceErrorMessagePart- the error message part for the sourcesourceType- the source type of the mappingtargetType- the type of the target mappingtargetPropertyName- the name of the target property
-
reportCannotCreateMapping
void reportCannotCreateMapping(Method method, javax.lang.model.element.AnnotationMirror posHint, java.lang.String sourceErrorMessagePart, Type sourceType, Type targetType, java.lang.String targetPropertyName)
Reports that a mapping could not be created.- Parameters:
method- the method that should be mappedposHint- hint which @Mapping is the culpritsourceErrorMessagePart- the error message part for the sourcesourceType- the source type of the mappingtargetType- the type of the target mappingtargetPropertyName- the name of the target property
-
-