Java Code Examples for org.jboss.jandex.AnnotationInstance#target()

The following examples show how to use org.jboss.jandex.AnnotationInstance#target() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SourceOperationHelper.java    From smallrye-graphql with Apache License 2.0 6 votes vote down vote up
public static Map<DotName, List<MethodParameterInfo>> getAllSourceAnnotations() {
    Map<DotName, List<MethodParameterInfo>> sourceFields = new HashMap<>();
    Collection<AnnotationInstance> sourceAnnotations = ScanningContext.getIndex().getAnnotations(Annotations.SOURCE);
    for (AnnotationInstance ai : sourceAnnotations) {
        AnnotationTarget target = ai.target();
        if (target.kind().equals(AnnotationTarget.Kind.METHOD_PARAMETER)) {
            MethodParameterInfo methodParameter = target.asMethodParameter();
            short position = methodParameter.position();
            DotName name = methodParameter.method().parameters().get(position).name();
            sourceFields.computeIfAbsent(name, k -> new ArrayList<>()).add(methodParameter);
        } else {
            LOG.warn("Ignoring " + ai.target() + " on kind " + ai.target().kind() + ". Only expecting @"
                    + Annotations.SOURCE.local() + " on Method parameters");
        }
    }
    return sourceFields;
}
 
Example 2
Source File: SchemaBuilder.java    From smallrye-graphql with Apache License 2.0 6 votes vote down vote up
private void addErrors(Schema schema) {
    Collection<AnnotationInstance> errorAnnotations = ScanningContext.getIndex().getAnnotations(Annotations.ERROR_CODE);
    if (errorAnnotations != null && !errorAnnotations.isEmpty()) {
        for (AnnotationInstance errorAnnotation : errorAnnotations) {
            AnnotationTarget annotationTarget = errorAnnotation.target();
            if (annotationTarget.kind().equals(AnnotationTarget.Kind.CLASS)) {
                ClassInfo exceptionClass = annotationTarget.asClass();
                AnnotationValue value = errorAnnotation.value();
                if (value != null && value.asString() != null && !value.asString().isEmpty()) {
                    schema.addError(new ErrorInfo(exceptionClass.name().toString(), value.asString()));
                } else {
                    LOG.warn("Ignoring @ErrorCode on " + annotationTarget.toString() + " - Annotation value is not set");
                }
            } else {
                LOG.warn("Ignoring @ErrorCode on " + annotationTarget.toString() + " - Wrong target, only apply to CLASS ["
                        + annotationTarget.kind().toString() + "]");
            }

        }
    }

}
 
Example 3
Source File: SpringCacheProcessor.java    From quarkus with Apache License 2.0 6 votes vote down vote up
private void validateUsage(AnnotationInstance instance) {
    if (instance.target().kind() != AnnotationTarget.Kind.METHOD) {
        throw new IllegalArgumentException(
                "Currently Spring Cache annotations can only be added to methods. Offending instance is annotation '"
                        + instance + "' on " + instance.target() + "'");
    }
    List<AnnotationValue> values = instance.values();
    List<String> unsupportedValues = new ArrayList<>();
    for (AnnotationValue value : values) {
        if (CURRENTLY_UNSUPPORTED_ANNOTATION_VALUES.contains(value.name())) {
            unsupportedValues.add(value.name());
        }
    }
    if (!unsupportedValues.isEmpty()) {
        throw new IllegalArgumentException("Annotation '" +
                instance + "' on '" + instance.target()
                + "' contains the following currently unsupported annotation values: "
                + String.join(", ", unsupportedValues));
    }
}
 
Example 4
Source File: SwaggerArchivePreparer.java    From thorntail with Apache License 2.0 5 votes vote down vote up
/**
 * Get the JAX-RS application path configured this deployment. If the IndexView is not available, or if there is no class
 * that has the annotated @ApplicationPath, then this method will return an empty string.
 *
 * @return the JAX-RS application path configured this deployment.
 */
private String getRestApplicationPath() {
    String path = "";
    // Check to see if we have any class annotated with the @ApplicationPath. If found, ensure that we set the context path
    // for Swagger resources to webAppContextPath + applicationPath.
    if (indexView != null) {
        DotName dotName = DotName.createSimple(ApplicationPath.class.getName());
        Collection<AnnotationInstance> instances = indexView.getAnnotations(dotName);
        Set<String> applicationPaths = new HashSet<>();
        for (AnnotationInstance ai : instances) {
            AnnotationTarget target = ai.target();
            if (target.kind() == AnnotationTarget.Kind.CLASS) {
                Object value = ai.value().value();
                if (value != null) {
                    applicationPaths.add(String.valueOf(value));
                }
            }
        }
        if (applicationPaths.size() > 1) {
            // We wouldn't know which application path to pick for serving the swagger resources. Let the deployment choose
            // this value explicitly.
            SwaggerMessages.MESSAGES.multipleApplicationPathsFound(applicationPaths);
        } else if (!applicationPaths.isEmpty()) {
            // Update the context path for swagger
            path = applicationPaths.iterator().next();
        }
    }
    return path;
}
 
Example 5
Source File: ConstructorPropertiesProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void registerInstance(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, AnnotationInstance instance) {
    AnnotationTarget annotationTarget = instance.target();
    if (annotationTarget instanceof MethodInfo) {
        MethodInfo methodInfo = (MethodInfo) annotationTarget;
        String classname = methodInfo.declaringClass().toString();
        reflectiveClass.produce(asReflectiveClassBuildItem(classname));
    }
}
 
Example 6
Source File: ResteasyServerCommonProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static boolean hasAnnotation(MethodInfo method, short paramPosition, DotName annotation) {
    for (AnnotationInstance annotationInstance : method.annotations()) {
        AnnotationTarget target = annotationInstance.target();
        if (target != null && target.kind() == Kind.METHOD_PARAMETER
                && target.asMethodParameter().position() == paramPosition
                && annotationInstance.name().equals(annotation)) {
            return true;
        }
    }
    return false;
}
 
Example 7
Source File: RestClientProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void findInterfaces(IndexView index, Map<DotName, ClassInfo> interfaces, Set<Type> returnTypes,
        DotName annotationToFind) {
    for (AnnotationInstance annotation : index.getAnnotations(annotationToFind)) {
        AnnotationTarget target = annotation.target();
        ClassInfo theInfo;
        if (target.kind() == AnnotationTarget.Kind.CLASS) {
            theInfo = target.asClass();
        } else if (target.kind() == AnnotationTarget.Kind.METHOD) {
            theInfo = target.asMethod().declaringClass();
        } else {
            continue;
        }

        if (!isRestClientInterface(index, theInfo)) {
            continue;
        }

        interfaces.put(theInfo.name(), theInfo);

        // Find Return types
        processInterfaceReturnTypes(theInfo, returnTypes);
        for (Type interfaceType : theInfo.interfaceTypes()) {
            ClassInfo interfaceClassInfo = index.getClassByName(interfaceType.name());
            if (interfaceClassInfo != null) {
                processInterfaceReturnTypes(interfaceClassInfo, returnTypes);
            }
        }
    }
}
 
Example 8
Source File: UndertowWebsocketProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void registerCodersForReflection(BuildProducer<ReflectiveClassBuildItem> reflection,
        Collection<AnnotationInstance> endpoints) {
    for (AnnotationInstance endpoint : endpoints) {
        if (endpoint.target() instanceof ClassInfo) {
            ClassInfo clazz = (ClassInfo) endpoint.target();
            if (!Modifier.isAbstract(clazz.flags())) {
                registerForReflection(reflection, endpoint.value("encoders"));
                registerForReflection(reflection, endpoint.value("decoders"));
            }
        }
    }
}
 
Example 9
Source File: SmallRyeOpenApiProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BuildStep
public void registerOpenApiSchemaClassesForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
        BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy,
        OpenApiFilteredIndexViewBuildItem openApiFilteredIndexViewBuildItem,
        Capabilities capabilities) {

    if (shouldScanAnnotations(capabilities)) {
        FilteredIndexView index = openApiFilteredIndexViewBuildItem.getIndex();
        // Generate reflection declaration from MP OpenAPI Schema definition
        // They are needed for serialization.
        Collection<AnnotationInstance> schemaAnnotationInstances = index.getAnnotations(OPENAPI_SCHEMA);
        for (AnnotationInstance schemaAnnotationInstance : schemaAnnotationInstances) {
            AnnotationTarget typeTarget = schemaAnnotationInstance.target();
            if (typeTarget.kind() != AnnotationTarget.Kind.CLASS) {
                continue;
            }
            reflectiveHierarchy
                    .produce(new ReflectiveHierarchyBuildItem(Type.create(typeTarget.asClass().name(), Type.Kind.CLASS),
                            IgnoreDotNames.IGNORE_FOR_REFLECTION_PREDICATE));
        }

        // Generate reflection declaration from MP OpenAPI APIResponse schema definition
        // They are needed for serialization
        Collection<AnnotationInstance> apiResponseAnnotationInstances = index.getAnnotations(OPENAPI_RESPONSE);
        registerReflectionForApiResponseSchemaSerialization(reflectiveClass, reflectiveHierarchy,
                apiResponseAnnotationInstances);

        // Generate reflection declaration from MP OpenAPI APIResponses schema definition
        // They are needed for serialization
        Collection<AnnotationInstance> apiResponsesAnnotationInstances = index.getAnnotations(OPENAPI_RESPONSES);
        for (AnnotationInstance apiResponsesAnnotationInstance : apiResponsesAnnotationInstances) {
            AnnotationValue apiResponsesAnnotationValue = apiResponsesAnnotationInstance.value();
            if (apiResponsesAnnotationValue == null) {
                continue;
            }
            registerReflectionForApiResponseSchemaSerialization(reflectiveClass, reflectiveHierarchy,
                    Arrays.asList(apiResponsesAnnotationValue.asNestedArray()));
        }
    }
}
 
Example 10
Source File: JpaJandexScavenger.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static void enlistEmbeddedsAndElementCollections(IndexView index, JpaEntitiesBuildItem domainObjectCollector,
        Set<String> enumTypeCollector, Set<String> javaTypeCollector, Set<DotName> unindexedClasses) {
    Set<DotName> embeddedTypes = new HashSet<>();

    for (DotName embeddedAnnotation : EMBEDDED_ANNOTATIONS) {
        Collection<AnnotationInstance> annotations = index.getAnnotations(embeddedAnnotation);

        for (AnnotationInstance annotation : annotations) {
            AnnotationTarget target = annotation.target();

            switch (target.kind()) {
                case FIELD:
                    collectEmbeddedTypes(embeddedTypes, target.asField().type());
                    break;
                case METHOD:
                    collectEmbeddedTypes(embeddedTypes, target.asMethod().returnType());
                    break;
                default:
                    throw new IllegalStateException(
                            "[internal error] " + embeddedAnnotation + " placed on a unknown element: " + target);
            }

        }
    }

    for (DotName embeddedType : embeddedTypes) {
        addClassHierarchyToReflectiveList(index, domainObjectCollector, enumTypeCollector, javaTypeCollector, embeddedType,
                unindexedClasses);
    }
}
 
Example 11
Source File: JsonbProcessor.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private void registerInstance(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, AnnotationInstance instance) {
    AnnotationTarget annotationTarget = instance.target();
    if (FIELD.equals(annotationTarget.kind()) || METHOD.equals(annotationTarget.kind())) {
        AnnotationValue value = instance.value();
        if (value != null) {
            // the Deserializers are constructed internally by JSON-B using a no-args constructor
            reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, value.asClass().toString()));
        }
    }
}
 
Example 12
Source File: AnnotationScanner.java    From smallrye-open-api with Apache License 2.0 5 votes vote down vote up
/**
 * Process the Extensions annotations
 * 
 * @param context the scanning context
 * @param method the current REST method
 * @param operation the current operation
 */
default void processExtensions(final AnnotationScannerContext context, final MethodInfo method, Operation operation) {
    List<AnnotationInstance> extensionAnnotations = ExtensionReader.getExtensionsAnnotations(method);

    if (extensionAnnotations.isEmpty()) {
        extensionAnnotations.addAll(ExtensionReader.getExtensionsAnnotations(method.declaringClass()));
    }
    for (AnnotationInstance annotation : extensionAnnotations) {
        if (annotation.target() == null || !METHOD_PARAMETER.equals(annotation.target().kind())) {
            String name = ExtensionReader.getExtensionName(annotation);
            operation.addExtension(name, ExtensionReader.readExtensionValue(context, name, annotation));
        }
    }
}
 
Example 13
Source File: ParameterProcessor.java    From smallrye-open-api with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieves the "value" parameter from annotation to be used as the name.
 * If no value was specified or an empty value, return the name of the annotation
 * target.
 *
 * @param annotation parameter annotation
 * @return the name of the parameter
 */
static String paramName(AnnotationInstance annotation) {
    AnnotationValue value = annotation.value();
    String valueString = null;

    if (value != null) {
        valueString = value.asString();
        if (valueString.length() > 0) {
            return valueString;
        }
    }

    AnnotationTarget target = annotation.target();

    switch (target.kind()) {
        case FIELD:
            valueString = target.asField().name();
            break;
        case METHOD_PARAMETER:
            valueString = target.asMethodParameter().name();
            break;
        case METHOD:
            // This is a bean property setter
            MethodInfo method = target.asMethod();
            if (method.parameters().size() == 1) {
                String methodName = method.name();

                if (methodName.startsWith("set")) {
                    valueString = Introspector.decapitalize(methodName.substring(3));
                } else {
                    valueString = methodName;
                }
            }
            break;
        default:
            break;
    }

    return valueString;
}
 
Example 14
Source File: ParameterProcessor.java    From smallrye-open-api with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieves the "value" parameter from annotation to be used as the name.
 * If no value was specified or an empty value, return the name of the annotation
 * target.
 *
 * @param annotation parameter annotation
 * @return the name of the parameter
 */
static String paramName(AnnotationInstance annotation) {
    AnnotationValue value = annotation.value();
    String valueString = null;

    if (value != null) {
        valueString = value.asString();
        if (valueString.length() > 0) {
            return valueString;
        }
    }

    AnnotationTarget target = annotation.target();

    switch (target.kind()) {
        case FIELD:
            valueString = target.asField().name();
            break;
        case METHOD_PARAMETER:
            valueString = target.asMethodParameter().name();
            break;
        case METHOD:
            // This is a bean property setter
            MethodInfo method = target.asMethod();
            if (method.parameters().size() == 1) {
                String methodName = method.name();

                if (methodName.startsWith("set")) {
                    valueString = Introspector.decapitalize(methodName.substring(3));
                } else {
                    valueString = methodName;
                }
            }
            break;
        default:
            break;
    }

    return valueString;
}
 
Example 15
Source File: EventBusCodecProcessor.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@BuildStep
public void registerCodecs(
        BeanArchiveIndexBuildItem beanArchiveIndexBuildItem,
        BuildProducer<MessageCodecBuildItem> messageCodecs) {

    final IndexView index = beanArchiveIndexBuildItem.getIndex();
    Collection<AnnotationInstance> consumeEventAnnotationInstances = index.getAnnotations(CONSUME_EVENT);
    Map<Type, DotName> codecByTypes = new HashMap<>();
    for (AnnotationInstance consumeEventAnnotationInstance : consumeEventAnnotationInstances) {
        AnnotationTarget typeTarget = consumeEventAnnotationInstance.target();
        if (typeTarget.kind() != AnnotationTarget.Kind.METHOD) {
            throw new UnsupportedOperationException("@ConsumeEvent annotation must target a method");
        }

        MethodInfo method = typeTarget.asMethod();
        Type codecTargetFromReturnType = extractPayloadTypeFromReturn(method);
        Type codecTargetFromParameter = extractPayloadTypeFromParameter(method);

        // If the @ConsumeEvent set the codec, use this codec. It applies to the parameter
        AnnotationValue codec = consumeEventAnnotationInstance.value("codec");
        if (codec != null && codec.asClass().kind() == Type.Kind.CLASS) {
            if (codecTargetFromParameter == null) {
                throw new IllegalStateException("Invalid `codec` argument in @ConsumeEvent - no parameter");
            }
            codecByTypes.put(codecTargetFromParameter, codec.asClass().asClassType().name());
        } else if (codecTargetFromParameter != null) {
            // Codec is not set, check if we have a built-in codec
            if (!hasBuiltInCodec(codecTargetFromParameter)) {
                // Ensure local delivery.
                AnnotationValue local = consumeEventAnnotationInstance.value("local");
                if (local != null && !local.asBoolean()) {
                    throw new UnsupportedOperationException(
                            "The generic message codec can only be used for local delivery,"
                                    + ", implement your own event bus codec for " + codecTargetFromParameter.name()
                                            .toString());
                } else if (!codecByTypes.containsKey(codecTargetFromParameter)) {
                    LOGGER.infof("Local Message Codec registered for type %s",
                            codecTargetFromParameter.toString());
                    codecByTypes.put(codecTargetFromParameter, LOCAL_EVENT_BUS_CODEC);
                }
            }
        }

        if (codecTargetFromReturnType != null && !hasBuiltInCodec(codecTargetFromReturnType)
                && !codecByTypes.containsKey(codecTargetFromReturnType)) {

            LOGGER.infof("Local Message Codec registered for type %s", codecTargetFromReturnType.toString());
            codecByTypes.put(codecTargetFromReturnType, LOCAL_EVENT_BUS_CODEC);
        }
    }

    // Produce the build items
    for (Map.Entry<Type, DotName> entry : codecByTypes.entrySet()) {
        messageCodecs.produce(new MessageCodecBuildItem(entry.getKey().toString(), entry.getValue().toString()));
    }

    // Register codec classes for reflection.
    codecByTypes.values().stream().map(DotName::toString).distinct()
            .forEach(name -> reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, name)));
}
 
Example 16
Source File: HibernateSearchElasticsearchProcessor.java    From quarkus with Apache License 2.0 4 votes vote down vote up
private void registerReflection(IndexView index, BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
        BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy) {
    Set<DotName> reflectiveClassCollector = new HashSet<>();

    if (buildTimeConfig.defaultBackend.analysis.configurer.isPresent()) {
        reflectiveClass.produce(
                new ReflectiveClassBuildItem(true, false, buildTimeConfig.defaultBackend.analysis.configurer.get()));
    }

    if (buildTimeConfig.defaultBackend.layout.strategy.isPresent()) {
        reflectiveClass.produce(
                new ReflectiveClassBuildItem(true, false, buildTimeConfig.defaultBackend.layout.strategy.get()));
    }

    if (buildTimeConfig.backgroundFailureHandler.isPresent()) {
        reflectiveClass.produce(
                new ReflectiveClassBuildItem(true, false, buildTimeConfig.backgroundFailureHandler.get()));
    }

    Set<Type> reflectiveHierarchyCollector = new HashSet<>();

    for (AnnotationInstance propertyMappingMetaAnnotationInstance : index
            .getAnnotations(PROPERTY_MAPPING_META_ANNOTATION)) {
        for (AnnotationInstance propertyMappingAnnotationInstance : index
                .getAnnotations(propertyMappingMetaAnnotationInstance.name())) {
            AnnotationTarget annotationTarget = propertyMappingAnnotationInstance.target();
            if (annotationTarget.kind() == Kind.FIELD) {
                FieldInfo fieldInfo = annotationTarget.asField();
                addReflectiveClass(index, reflectiveClassCollector, reflectiveHierarchyCollector,
                        fieldInfo.declaringClass());
                addReflectiveType(index, reflectiveClassCollector, reflectiveHierarchyCollector,
                        fieldInfo.type());
            } else if (annotationTarget.kind() == Kind.METHOD) {
                MethodInfo methodInfo = annotationTarget.asMethod();
                addReflectiveClass(index, reflectiveClassCollector, reflectiveHierarchyCollector,
                        methodInfo.declaringClass());
                addReflectiveType(index, reflectiveClassCollector, reflectiveHierarchyCollector,
                        methodInfo.returnType());
            }
        }
    }

    for (AnnotationInstance typeBridgeMappingInstance : index.getAnnotations(TYPE_MAPPING_META_ANNOTATION)) {
        for (AnnotationInstance typeBridgeInstance : index.getAnnotations(typeBridgeMappingInstance.name())) {
            addReflectiveClass(index, reflectiveClassCollector, reflectiveHierarchyCollector,
                    typeBridgeInstance.target().asClass());
        }
    }

    reflectiveClassCollector.addAll(GSON_CLASSES);

    String[] reflectiveClasses = reflectiveClassCollector.stream().map(DotName::toString).toArray(String[]::new);
    reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, reflectiveClasses));

    for (Type reflectiveHierarchyType : reflectiveHierarchyCollector) {
        reflectiveHierarchy.produce(new ReflectiveHierarchyBuildItem(reflectiveHierarchyType));
    }
}
 
Example 17
Source File: PicocliNativeImageProcessor.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@BuildStep(onlyIf = NativeImageProcessingEnabled.class)
void reflectionConfiguration(CombinedIndexBuildItem combinedIndexBuildItem,
        BuildProducer<ReflectiveFieldBuildItem> reflectiveFields,
        BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
        BuildProducer<NativeImageProxyDefinitionBuildItem> nativeImageProxies) {
    IndexView index = combinedIndexBuildItem.getIndex();

    Collection<DotName> annotationsToAnalyze = Arrays.asList(
            DotName.createSimple(CommandLine.ArgGroup.class.getName()),
            DotName.createSimple(CommandLine.Command.class.getName()),
            DotName.createSimple(CommandLine.Mixin.class.getName()),
            DotName.createSimple(CommandLine.Option.class.getName()),
            DotName.createSimple(CommandLine.Parameters.class.getName()),
            DotName.createSimple(CommandLine.ParentCommand.class.getName()),
            DotName.createSimple(CommandLine.Spec.class.getName()),
            DotName.createSimple(CommandLine.Unmatched.class.getName()));

    Set<ClassInfo> foundClasses = new HashSet<>();
    Set<FieldInfo> foundFields = new HashSet<>();
    for (DotName analyzedAnnotation : annotationsToAnalyze) {
        for (AnnotationInstance ann : index.getAnnotations(analyzedAnnotation)) {
            AnnotationTarget target = ann.target();
            switch (target.kind()) {
                case CLASS:
                    foundClasses.add(target.asClass());
                    break;
                case FIELD:
                    foundFields.add(target.asField());
                    // This may be class which will be used as Mixin. We need to be sure that Picocli will be able
                    // to initialize those even if they are not beans.
                    foundClasses.add(target.asField().declaringClass());
                    break;
                case METHOD:
                    foundClasses.add(target.asMethod().declaringClass());
                    break;
                case METHOD_PARAMETER:
                    foundClasses.add(target.asMethodParameter().method().declaringClass());
                    break;
                default:
                    LOGGER.warnf("Unsupported type %s annotated with %s", target.kind().name(), analyzedAnnotation);
                    break;
            }
        }
    }

    Arrays.asList(DotName.createSimple(CommandLine.IVersionProvider.class.getName()),
            DotName.createSimple(CommandLine.class.getName()))
            .forEach(interfaceName -> foundClasses.addAll(index.getAllKnownImplementors(interfaceName)));

    foundClasses.forEach(classInfo -> {
        if (Modifier.isInterface(classInfo.flags())) {
            nativeImageProxies
                    .produce(new NativeImageProxyDefinitionBuildItem(classInfo.name().toString()));
            reflectiveClasses
                    .produce(new ReflectiveClassBuildItem(false, true, false, classInfo.name().toString()));
        } else {
            reflectiveClasses
                    .produce(new ReflectiveClassBuildItem(true, true, false, classInfo.name().toString()));
        }
    });
    foundFields.forEach(fieldInfo -> reflectiveFields.produce(new ReflectiveFieldBuildItem(fieldInfo)));
}