Search in sources :

Example 1 with ServiceNowSysParm

use of org.apache.camel.component.servicenow.annotations.ServiceNowSysParm in project camel-quarkus by apache.

the class ServicenowProcessor method registerForReflection.

@BuildStep
void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, CombinedIndexBuildItem combinedIndex) {
    IndexView index = combinedIndex.getIndex();
    // Get candidate DTOs annotated with ServiceNowSysParm
    String[] serviceNowDtos = index.getAnnotations(DotName.createSimple(ServiceNowSysParm.class.getName())).stream().map(AnnotationInstance::target).filter(annotationTarget -> annotationTarget.kind().equals(AnnotationTarget.Kind.CLASS)).map(AnnotationTarget::asClass).filter(CamelSupport::isConcrete).filter(CamelSupport::isPublic).map(classInfo -> classInfo.name().toString()).filter(className -> !className.startsWith("org.apache.camel.component.servicenow.model")).toArray(String[]::new);
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, true, serviceNowDtos));
    reflectiveClass.produce(new ReflectiveClassBuildItem(false, true, HTTPTransportFactory.class, ServiceNowExceptionModel.class));
}
Also used : HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) IndexView(org.jboss.jandex.IndexView) ExtensionSslNativeSupportBuildItem(io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem) ReflectiveClassBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem) CamelSupport(org.apache.camel.quarkus.core.deployment.util.CamelSupport) ServiceNowExceptionModel(org.apache.camel.component.servicenow.ServiceNowExceptionModel) DotName(org.jboss.jandex.DotName) CombinedIndexBuildItem(io.quarkus.deployment.builditem.CombinedIndexBuildItem) BuildProducer(io.quarkus.deployment.annotations.BuildProducer) BuildStep(io.quarkus.deployment.annotations.BuildStep) FeatureBuildItem(io.quarkus.deployment.builditem.FeatureBuildItem) AnnotationInstance(org.jboss.jandex.AnnotationInstance) AnnotationTarget(org.jboss.jandex.AnnotationTarget) ServiceNowSysParm(org.apache.camel.component.servicenow.annotations.ServiceNowSysParm) ServiceNowSysParm(org.apache.camel.component.servicenow.annotations.ServiceNowSysParm) IndexView(org.jboss.jandex.IndexView) ServiceNowExceptionModel(org.apache.camel.component.servicenow.ServiceNowExceptionModel) HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) CamelSupport(org.apache.camel.quarkus.core.deployment.util.CamelSupport) ReflectiveClassBuildItem(io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Aggregations

BuildProducer (io.quarkus.deployment.annotations.BuildProducer)1 BuildStep (io.quarkus.deployment.annotations.BuildStep)1 CombinedIndexBuildItem (io.quarkus.deployment.builditem.CombinedIndexBuildItem)1 ExtensionSslNativeSupportBuildItem (io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem)1 FeatureBuildItem (io.quarkus.deployment.builditem.FeatureBuildItem)1 ReflectiveClassBuildItem (io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem)1 ServiceNowExceptionModel (org.apache.camel.component.servicenow.ServiceNowExceptionModel)1 ServiceNowSysParm (org.apache.camel.component.servicenow.annotations.ServiceNowSysParm)1 CamelSupport (org.apache.camel.quarkus.core.deployment.util.CamelSupport)1 HTTPTransportFactory (org.apache.cxf.transport.http.HTTPTransportFactory)1 AnnotationInstance (org.jboss.jandex.AnnotationInstance)1 AnnotationTarget (org.jboss.jandex.AnnotationTarget)1 DotName (org.jboss.jandex.DotName)1 IndexView (org.jboss.jandex.IndexView)1