use of org.mapstruct.ap.internal.gem.ValueMappingGem in project mapstruct by mapstruct.
the class MethodRetrievalProcessor method getValueMappings.
/**
* Retrieves the mappings configured via {@code @ValueMapping} from the given
* method.
*
* @param method The method of interest
*
* @return The mappings for the given method, keyed by target property name
*/
private List<ValueMappingOptions> getValueMappings(ExecutableElement method) {
List<ValueMappingOptions> valueMappings = new ArrayList<>();
ValueMappingGem mappingAnnotation = ValueMappingGem.instanceOn(method);
ValueMappingsGem mappingsAnnotation = ValueMappingsGem.instanceOn(method);
if (mappingAnnotation != null) {
ValueMappingOptions valueMapping = ValueMappingOptions.fromMappingGem(mappingAnnotation);
if (valueMapping != null) {
valueMappings.add(valueMapping);
}
}
if (mappingsAnnotation != null) {
ValueMappingOptions.fromMappingsGem(mappingsAnnotation, method, messager, valueMappings);
}
return valueMappings;
}
Aggregations