Search in sources :

Example 1 with ReflectiveHierarchyBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem in project camel-quarkus by apache.

the class HazelcastProcessor method registerTypeHierarchy.

private static void registerTypeHierarchy(BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass, BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> ignoreWarnings, Class<?>... classNames) {
    for (Class<?> klass : classNames) {
        DotName simpleName = DotName.createSimple(klass.getName());
        reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder().type(Type.create(simpleName, Type.Kind.CLASS)).build());
        ignoreWarnings.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(simpleName));
    }
}
Also used : ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) DotName(org.jboss.jandex.DotName)

Example 2 with ReflectiveHierarchyBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem in project kogito-runtimes by kiegroup.

the class ProcessesAssetsProcessor method addInnerClasses.

private void addInnerClasses(Class<?> superClass, BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass) {
    DotName dotName = DotName.createSimple(superClass.getName());
    Type type = Type.create(dotName, Type.Kind.CLASS);
    reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder().type(type).build());
    asList(superClass.getDeclaredClasses()).forEach(c -> {
        addInnerClasses(c, reflectiveHierarchyClass);
    });
}
Also used : GeneratedFileType(org.kie.kogito.codegen.api.GeneratedFileType) Type(org.jboss.jandex.Type) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) DotName(org.jboss.jandex.DotName)

Example 3 with ReflectiveHierarchyBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem in project quarkus-github-app by quarkiverse.

the class GitHubAppProcessor method registerForReflection.

@BuildStep
void registerForReflection(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClasses, BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchies) {
    // Types used for config files
    for (AnnotationInstance configFileAnnotationInstance : combinedIndex.getIndex().getAnnotations(CONFIG_FILE)) {
        MethodParameterInfo methodParameter = configFileAnnotationInstance.target().asMethodParameter();
        short parameterPosition = methodParameter.position();
        Type parameterType = methodParameter.method().parameters().get(parameterPosition);
        reflectiveHierarchies.produce(new ReflectiveHierarchyBuildItem.Builder().type(parameterType).index(combinedIndex.getIndex()).source(GitHubAppProcessor.class.getSimpleName() + " > " + methodParameter.method().declaringClass() + "#" + methodParameter.method()).build());
    }
    // Caffeine
    reflectiveClasses.produce(new ReflectiveClassBuildItem(true, true, "com.github.benmanes.caffeine.cache.SSMSA", "com.github.benmanes.caffeine.cache.PSWMS"));
}
Also used : Type(org.jboss.jandex.Type) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) MethodParameterInfo(org.jboss.jandex.MethodParameterInfo) AnnotationInstance(org.jboss.jandex.AnnotationInstance) ReflectiveClassBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Example 4 with ReflectiveHierarchyBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem in project quarkus-hazelcast-client by hazelcast.

the class HazelcastClientProcessor method registerTypeHierarchy.

private static void registerTypeHierarchy(BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchyClass, BuildProducer<ReflectiveHierarchyIgnoreWarningBuildItem> ignoreWarnings, Class<?>... classNames) {
    for (Class<?> klass : classNames) {
        DotName simpleName = DotName.createSimple(klass.getName());
        reflectiveHierarchyClass.produce(new ReflectiveHierarchyBuildItem.Builder().type(Type.create(simpleName, Type.Kind.CLASS)).build());
        ignoreWarnings.produce(new ReflectiveHierarchyIgnoreWarningBuildItem(simpleName));
    }
}
Also used : ReflectiveHierarchyIgnoreWarningBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) DotName(org.jboss.jandex.DotName)

Example 5 with ReflectiveHierarchyBuildItem

use of io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem in project quarkus-github-action by quarkiverse.

the class GitHubActionProcessor method registerForReflection.

@BuildStep
void registerForReflection(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClasses, BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchies) {
    // Types used for config files
    for (AnnotationInstance configFileAnnotationInstance : combinedIndex.getIndex().getAnnotations(CONFIG_FILE)) {
        MethodParameterInfo methodParameter = configFileAnnotationInstance.target().asMethodParameter();
        short parameterPosition = methodParameter.position();
        Type parameterType = methodParameter.method().parameters().get(parameterPosition);
        reflectiveHierarchies.produce(new ReflectiveHierarchyBuildItem.Builder().type(parameterType).index(combinedIndex.getIndex()).source(GitHubActionProcessor.class.getSimpleName() + " > " + methodParameter.method().declaringClass() + "#" + methodParameter.method()).build());
    }
}
Also used : Type(org.jboss.jandex.Type) ReflectiveHierarchyBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem) MethodParameterInfo(org.jboss.jandex.MethodParameterInfo) AnnotationInstance(org.jboss.jandex.AnnotationInstance) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Aggregations

ReflectiveHierarchyBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem)5 DotName (org.jboss.jandex.DotName)3 Type (org.jboss.jandex.Type)3 BuildStep (io.quarkus.deployment.annotations.BuildStep)2 ReflectiveHierarchyIgnoreWarningBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyIgnoreWarningBuildItem)2 AnnotationInstance (org.jboss.jandex.AnnotationInstance)2 MethodParameterInfo (org.jboss.jandex.MethodParameterInfo)2 ReflectiveClassBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem)1 GeneratedFileType (org.kie.kogito.codegen.api.GeneratedFileType)1