Package org.mapstruct.ap.internal.model
Class MappingBuilderContext
java.lang.Object
org.mapstruct.ap.internal.model.MappingBuilderContext
This class provides the context for the builders.
The context provides:
- Input for the building process, such as the source model (mapping methods found) and mapper references.
- Required factory, utility, reporting methods for building the mappings.
- Means to harbor results produced by the builders, such as forged- and supported mapping methods that should be generated in a later stage.
- Author:
- Sjaak Derksen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceResolves the most suitable way for mapping an element (property, iterable element etc.) from source to target. -
Constructor Summary
ConstructorsConstructorDescriptionMappingBuilderContext(TypeFactory typeFactory, ElementUtils elementUtils, TypeUtils typeUtils, FormattingMessager messager, VersionInformation versionInformation, AccessorNamingUtils accessorNaming, EnumMappingStrategy enumMappingStrategy, Map<String, EnumTransformationStrategy> enumTransformationStrategies, Options options, MappingBuilderContext.MappingResolver mappingResolver, TypeElement mapper, List<SourceMethod> sourceModel, List<MapperReference> mapperReferences) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanGenerateAutoSubMappingBetween(Type sourceType, Type targetType) getExistingMappingMethod(MappingMethod newMappingMethod) Returns a map which is used to track which forged methods are under creation.boolean
-
Constructor Details
-
MappingBuilderContext
public MappingBuilderContext(TypeFactory typeFactory, ElementUtils elementUtils, TypeUtils typeUtils, FormattingMessager messager, VersionInformation versionInformation, AccessorNamingUtils accessorNaming, EnumMappingStrategy enumMappingStrategy, Map<String, EnumTransformationStrategy> enumTransformationStrategies, Options options, MappingBuilderContext.MappingResolver mappingResolver, TypeElement mapper, List<SourceMethod> sourceModel, List<MapperReference> mapperReferences)
-
-
Method Details
-
getForgedMethodsUnderCreation
Returns a map which is used to track which forged methods are under creation. Used for cutting the possible infinite recursion of forged method creation. Map is used instead of set because not all fields of ForgedMethods are used in equals/hashCode and we are interested only in the first created ForgedMethod- Returns:
- map of forged methods
-
getMapperTypeElement
-
getSourceModel
-
getMapperReferences
-
getTypeFactory
-
getElementUtils
-
getTypeUtils
-
getMessager
-
getVersionInformation
-
getAccessorNaming
-
getEnumMappingStrategy
-
getEnumTransformationStrategies
-
getOptions
-
getMappingResolver
-
getMappingsToGenerate
-
getReservedNames
-
getExistingMappingMethod
-
getUsedSupportedMappings
-
getUsedSupportedFields
-
canGenerateAutoSubMappingBetween
- Parameters:
sourceType- from which an automatic sub-mapping needs to be generatedtargetType- to which an automatic sub-mapping needs to be generated- Returns:
trueif MapStruct is allowed to try and generate an automatic sub-mapping between the source and targetType
-
isErroneous
public boolean isErroneous()
-