Package org.mapstruct.ap.internal.model
Class SupportingMappingMethod
java.lang.Object
org.mapstruct.ap.internal.writer.FreeMarkerWritable
org.mapstruct.ap.internal.model.common.ModelElement
org.mapstruct.ap.internal.model.GeneratedTypeMethod
org.mapstruct.ap.internal.model.MappingMethod
org.mapstruct.ap.internal.model.SupportingMappingMethod
- All Implemented Interfaces:
Writable
A mapping method which is not based on an actual method declared in the original mapper interface but is added as
private method to map a certain source/target type combination. Based on a
BuiltInMethod.
Specific templates all point to this class, for instance:
XmlGregorianCalendarToCalendar,
but also used fields and constructor elements, e.g.
FinalField and
NewDatatypeFactoryConstructorFragment- Author:
- Gunnar Morling
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context -
Constructor Summary
ConstructorsConstructorDescriptionSupportingMappingMethod(HelperMethod method) SupportingMappingMethod(BuiltInMethod method, Set<Field> existingFields) -
Method Summary
Methods inherited from class org.mapstruct.ap.internal.model.MappingMethod
filterMappingTarget, getAccessibility, getAfterMappingReferences, getBeforeMappingReferencesWithMappingTarget, getBeforeMappingReferencesWithoutMappingTarget, getName, getParameterNames, getParameters, getResultName, getResultType, getReturnType, getSourceParameters, getThrownTypes, isExistingInstanceMapping, isStatic, toStringMethods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateNameForClass, write
-
Constructor Details
-
SupportingMappingMethod
-
SupportingMappingMethod
-
-
Method Details
-
getTemplateName
Description copied from class:FreeMarkerWritableReturns the name of the template to be used for a specific writable type. By default,FreeMarkerWritable.getTemplateNameForClass(Class)is called withgetClass(), but this can be customized by overriding this method if required.- Overrides:
getTemplateNamein classFreeMarkerWritable- Returns:
- the name of the template. Must not be
null.
-
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 classMappingMethod- Returns:
- A set with type referenced by this model element. Must not be
null.
-
findType
Finds aTypeby a given name. Thenamewill be compared to the fully-qualified and also simple names of theimportTypes.- Parameters:
name- Fully-qualified or simple name of the type.- Returns:
- Found type, never
null. - Throws:
IllegalArgumentException- In case noTypewas found for given name.
-
getSupportingField
-
getSupportingConstructorFragment
-
getTemplateParameter
-
hashCode
public int hashCode()- Overrides:
hashCodein classMappingMethod
-
equals
- Overrides:
equalsin classMappingMethod
-