Package org.mapstruct.ap.internal.model
Class PropertyMapping
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.PropertyMapping
-
- All Implemented Interfaces:
Writable
public class PropertyMapping extends ModelElement
Represents the mapping between a source and target property, e.g. fromString Source#foo
toint Target#bar
. Name and type of source and target property can differ. If they have different types, the mapping must either refer to a mapping method or a conversion.- Author:
- Gunnar Morling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PropertyMapping.ConstantMappingBuilder
static class
PropertyMapping.JavaExpressionMappingBuilder
static class
PropertyMapping.PropertyMappingBuilder
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Assignment
getAssignment()
Assignment
getDefaultValueAssignment()
Set<String>
getDependsOn()
Set<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.String
getName()
String
getSourceBeanName()
String
getSourcePropertyName()
String
getTargetReadAccessorName()
Type
getTargetType()
String
getTargetWriteAccessorName()
int
hashCode()
boolean
isConstructorMapping()
String
toString()
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name of this mapping (property name on the target side)
-
getSourcePropertyName
public String getSourcePropertyName()
-
getSourceBeanName
public String getSourceBeanName()
-
getTargetWriteAccessorName
public String getTargetWriteAccessorName()
-
getTargetReadAccessorName
public String getTargetReadAccessorName()
-
getTargetType
public Type getTargetType()
-
getAssignment
public Assignment getAssignment()
-
getDefaultValueAssignment
public Assignment getDefaultValueAssignment()
-
isConstructorMapping
public boolean isConstructorMapping()
-
getImportTypes
public Set<Type> getImportTypes()
Description copied from class:ModelElement
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypes
in classModelElement
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
-