Search in sources :

Example 16 with SourceMethod

use of org.mapstruct.ap.internal.model.source.SourceMethod in project mapstruct by mapstruct.

the class MethodRetrievalProcessor method process.

@Override
public List<SourceMethod> process(ProcessorContext context, TypeElement mapperTypeElement, Void sourceModel) {
    this.messager = context.getMessager();
    this.typeFactory = context.getTypeFactory();
    this.typeUtils = context.getTypeUtils();
    this.elementUtils = context.getElementUtils();
    MapperConfiguration mapperConfig = MapperConfiguration.getInstanceOn(mapperTypeElement);
    if (!mapperConfig.isValid()) {
        throw new AnnotationProcessingException("Couldn't retrieve @Mapper annotation", mapperTypeElement, mapperConfig.getAnnotationMirror());
    }
    List<SourceMethod> prototypeMethods = retrievePrototypeMethods(mapperTypeElement, mapperConfig);
    return retrieveMethods(mapperTypeElement, mapperTypeElement, mapperConfig, prototypeMethods);
}
Also used : MapperConfiguration(org.mapstruct.ap.internal.util.MapperConfiguration) AnnotationProcessingException(org.mapstruct.ap.internal.util.AnnotationProcessingException) SourceMethod(org.mapstruct.ap.internal.model.source.SourceMethod)

Aggregations

SourceMethod (org.mapstruct.ap.internal.model.source.SourceMethod)16 ArrayList (java.util.ArrayList)12 DeclaredType (javax.lang.model.type.DeclaredType)3 Parameter (org.mapstruct.ap.internal.model.common.Parameter)3 Type (org.mapstruct.ap.internal.model.common.Type)3 LinkedList (java.util.LinkedList)2 List (java.util.List)2 AnnotationMirror (javax.lang.model.element.AnnotationMirror)2 ExecutableElement (javax.lang.model.element.ExecutableElement)2 TypeElement (javax.lang.model.element.TypeElement)2 ExecutableType (javax.lang.model.type.ExecutableType)2 TypeMirror (javax.lang.model.type.TypeMirror)2 BeanMappingMethod (org.mapstruct.ap.internal.model.BeanMappingMethod)2 ContainerMappingMethod (org.mapstruct.ap.internal.model.ContainerMappingMethod)2 ContainerMappingMethodBuilder (org.mapstruct.ap.internal.model.ContainerMappingMethodBuilder)2 EnumMappingMethod (org.mapstruct.ap.internal.model.EnumMappingMethod)2 IterableMappingMethod (org.mapstruct.ap.internal.model.IterableMappingMethod)2 MapMappingMethod (org.mapstruct.ap.internal.model.MapMappingMethod)2 MappingMethod (org.mapstruct.ap.internal.model.MappingMethod)2 StreamMappingMethod (org.mapstruct.ap.internal.model.StreamMappingMethod)2