Package org.mapstruct.ap.internal.model
Class MappingBuilderContext
- java.lang.Object
-
- org.mapstruct.ap.internal.model.MappingBuilderContext
-
public class MappingBuilderContext extends Object
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 Classes Modifier and Type Class Description static interface
MappingBuilderContext.MappingResolver
Resolves the most suitable way for mapping an element (property, iterable element etc.) from source to target.
-
Constructor Summary
Constructors Constructor Description MappingBuilderContext(TypeFactory typeFactory, ElementUtils elementUtils, TypeUtils typeUtils, FormattingMessager messager, AccessorNamingUtils accessorNaming, EnumMappingStrategy enumMappingStrategy, Map<String,EnumTransformationStrategy> enumTransformationStrategies, Options options, MappingBuilderContext.MappingResolver mappingResolver, TypeElement mapper, List<SourceMethod> sourceModel, List<MapperReference> mapperReferences)
-
Method Summary
-
-
-
Constructor Detail
-
MappingBuilderContext
public MappingBuilderContext(TypeFactory typeFactory, ElementUtils elementUtils, TypeUtils typeUtils, FormattingMessager messager, AccessorNamingUtils accessorNaming, EnumMappingStrategy enumMappingStrategy, Map<String,EnumTransformationStrategy> enumTransformationStrategies, Options options, MappingBuilderContext.MappingResolver mappingResolver, TypeElement mapper, List<SourceMethod> sourceModel, List<MapperReference> mapperReferences)
-
-
Method Detail
-
getForgedMethodsUnderCreation
public Map<ForgedMethod,ForgedMethod> 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
public TypeElement getMapperTypeElement()
-
getSourceModel
public List<SourceMethod> getSourceModel()
-
getMapperReferences
public List<MapperReference> getMapperReferences()
-
getTypeFactory
public TypeFactory getTypeFactory()
-
getElementUtils
public ElementUtils getElementUtils()
-
getTypeUtils
public TypeUtils getTypeUtils()
-
getMessager
public FormattingMessager getMessager()
-
getAccessorNaming
public AccessorNamingUtils getAccessorNaming()
-
getEnumMappingStrategy
public EnumMappingStrategy getEnumMappingStrategy()
-
getEnumTransformationStrategies
public Map<String,EnumTransformationStrategy> getEnumTransformationStrategies()
-
getOptions
public Options getOptions()
-
getMappingResolver
public MappingBuilderContext.MappingResolver getMappingResolver()
-
getMappingsToGenerate
public List<MappingMethod> getMappingsToGenerate()
-
getExistingMappingMethod
public MappingMethod getExistingMappingMethod(MappingMethod newMappingMethod)
-
getUsedSupportedMappings
public Set<SupportingMappingMethod> getUsedSupportedMappings()
-
canGenerateAutoSubMappingBetween
public boolean canGenerateAutoSubMappingBetween(Type sourceType, Type targetType)
- Parameters:
sourceType
- from which an automatic sub-mapping needs to be generatedtargetType
- to which an automatic sub-mapping needs to be generated- Returns:
true
if MapStruct is allowed to try and generate an automatic sub-mapping between the source and targetType
-
isErroneous
public boolean isErroneous()
-
-