Package org.mapstruct.ap.internal.model
Class BeanMappingMethod
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.MappingMethod
-
- org.mapstruct.ap.internal.model.NormalTypeMappingMethod
-
- org.mapstruct.ap.internal.model.BeanMappingMethod
-
- All Implemented Interfaces:
Writable
public class BeanMappingMethod extends NormalTypeMappingMethod
AMappingMethodimplemented by aMapperclass which maps one bean type to another, optionally configured by one or morePropertyMappings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBeanMappingMethod.Builderprivate static classBeanMappingMethod.ConstructorAccessor-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<PropertyMapping>constantMappingsprivate java.util.List<PropertyMapping>constructorConstantMappingsprivate java.util.Map<java.lang.String,java.util.List<PropertyMapping>>constructorMappingsByParameterprivate MethodReferencefinalizerMethodprivate MappingReferencesmappingReferencesprivate java.util.Map<java.lang.String,java.util.List<PropertyMapping>>mappingsByParameterprivate java.util.List<PropertyMapping>propertyMappingsprivate BuilderTypereturnTypeBuilderprivate TypereturnTypeToConstructprivate java.util.List<SubclassMapping>subclassMappings
-
Constructor Summary
Constructors Modifier Constructor Description privateBeanMappingMethod(Method method, java.util.Collection<java.lang.String> existingVariableNames, java.util.List<PropertyMapping> propertyMappings, MethodReference factoryMethod, boolean mapNullToDefault, Type returnTypeToConstruct, BuilderType returnTypeBuilder, java.util.List<LifecycleCallbackMethodReference> beforeMappingReferences, java.util.List<LifecycleCallbackMethodReference> afterMappingReferences, MethodReference finalizerMethod, MappingReferences mappingReferences, java.util.List<SubclassMapping> subclassMappings)
-
Method Summary
-
Methods inherited from class org.mapstruct.ap.internal.model.NormalTypeMappingMethod
getFactoryMethod, isMapNullToDefault, isOverridden
-
Methods inherited from class org.mapstruct.ap.internal.model.MappingMethod
getAccessibility, getAfterMappingReferences, getBeforeMappingReferencesWithMappingTarget, getBeforeMappingReferencesWithoutMappingTarget, getName, getParameterNames, getParameters, getResultName, getResultType, getReturnType, getSourceParameters, getThrownTypes, isExistingInstanceMapping, isStatic, toString
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Field Detail
-
propertyMappings
private final java.util.List<PropertyMapping> propertyMappings
-
mappingsByParameter
private final java.util.Map<java.lang.String,java.util.List<PropertyMapping>> mappingsByParameter
-
constructorMappingsByParameter
private final java.util.Map<java.lang.String,java.util.List<PropertyMapping>> constructorMappingsByParameter
-
constantMappings
private final java.util.List<PropertyMapping> constantMappings
-
constructorConstantMappings
private final java.util.List<PropertyMapping> constructorConstantMappings
-
subclassMappings
private final java.util.List<SubclassMapping> subclassMappings
-
returnTypeToConstruct
private final Type returnTypeToConstruct
-
returnTypeBuilder
private final BuilderType returnTypeBuilder
-
finalizerMethod
private final MethodReference finalizerMethod
-
mappingReferences
private final MappingReferences mappingReferences
-
-
Constructor Detail
-
BeanMappingMethod
private BeanMappingMethod(Method method, java.util.Collection<java.lang.String> existingVariableNames, java.util.List<PropertyMapping> propertyMappings, MethodReference factoryMethod, boolean mapNullToDefault, Type returnTypeToConstruct, BuilderType returnTypeBuilder, java.util.List<LifecycleCallbackMethodReference> beforeMappingReferences, java.util.List<LifecycleCallbackMethodReference> afterMappingReferences, MethodReference finalizerMethod, MappingReferences mappingReferences, java.util.List<SubclassMapping> subclassMappings)
-
-
Method Detail
-
getConstantMappings
public java.util.List<PropertyMapping> getConstantMappings()
-
getConstructorConstantMappings
public java.util.List<PropertyMapping> getConstructorConstantMappings()
-
getSubclassMappings
public java.util.List<SubclassMapping> getSubclassMappings()
-
propertyMappingsByParameter
public java.util.List<PropertyMapping> propertyMappingsByParameter(Parameter parameter)
-
constructorPropertyMappingsByParameter
public java.util.List<PropertyMapping> constructorPropertyMappingsByParameter(Parameter parameter)
-
getReturnTypeToConstruct
public Type getReturnTypeToConstruct()
-
hasSubclassMappings
public boolean hasSubclassMappings()
-
isAbstractReturnType
public boolean isAbstractReturnType()
-
hasConstructorMappings
public boolean hasConstructorMappings()
-
getFinalizerMethod
public MethodReference getFinalizerMethod()
-
getImportTypes
public java.util.Set<Type> getImportTypes()
Description copied from class:ModelElementReturns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.- Overrides:
getImportTypesin classNormalTypeMappingMethod- Returns:
- A set with type referenced by this model element. Must not be
null.
-
getSourceParametersExcludingPrimitives
public java.util.List<Parameter> getSourceParametersExcludingPrimitives()
-
getSourceParametersNeedingNullCheck
public java.util.List<Parameter> getSourceParametersNeedingNullCheck()
-
getSourceParametersNotNeedingNullCheck
public java.util.List<Parameter> getSourceParametersNotNeedingNullCheck()
-
needsNullCheck
private boolean needsNullCheck(Parameter parameter)
-
doesNotNeedNullCheckForSourceParameter
private boolean doesNotNeedNullCheckForSourceParameter(PropertyMapping mapping)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classNormalTypeMappingMethod
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classNormalTypeMappingMethod
-
-