use of org.mapstruct.ap.internal.model.Field in project mapstruct by mapstruct.
the class AnnotationBasedComponentModelProcessor method buildAnnotatedConstructorForDecorator.
private AnnotatedConstructor buildAnnotatedConstructorForDecorator(Decorator decorator) {
List<AnnotationMapperReference> mapperReferencesForConstructor = new ArrayList<AnnotationMapperReference>(decorator.getFields().size());
for (Field field : decorator.getFields()) {
if (field instanceof AnnotationMapperReference) {
mapperReferencesForConstructor.add((AnnotationMapperReference) field);
}
}
List<Annotation> mapperReferenceAnnotations = getMapperReferenceAnnotations();
removeDuplicateAnnotations(mapperReferencesForConstructor, mapperReferenceAnnotations);
return new AnnotatedConstructor(decorator.getName(), mapperReferencesForConstructor, mapperReferenceAnnotations, additionalPublicEmptyConstructor());
}
use of org.mapstruct.ap.internal.model.Field in project mapstruct by mapstruct.
the class AnnotationBasedComponentModelProcessor method adjustDecorator.
protected void adjustDecorator(Mapper mapper, InjectionStrategyPrism injectionStrategy) {
Decorator decorator = mapper.getDecorator();
for (Annotation typeAnnotation : getDecoratorAnnotations()) {
decorator.addAnnotation(typeAnnotation);
}
decorator.removeConstructor();
List<Annotation> annotations = getDelegatorReferenceAnnotations(mapper);
List<Field> replacement = new ArrayList<Field>();
if (!decorator.getMethods().isEmpty()) {
for (Field field : decorator.getFields()) {
replacement.add(replacementMapperReference(field, annotations, injectionStrategy));
}
}
decorator.setFields(replacement);
}
Aggregations