use of org.apache.camel.quarkus.core.deployment.catalog.SchemaResource in project camel-quarkus by apache.
the class CamelUnremovableBeansProcessor method buildTimeCamelCatalog.
@BuildStep
BuildTimeCamelCatalogBuildItem buildTimeCamelCatalog(CombinedIndexBuildItem combinedIndex) {
Set<SchemaResource> resources = new HashSet<>();
IndexView index = combinedIndex.getIndex();
List<AnnotationInstance> annotations = Stream.of(CATALOG_SCHEMA_TYPES).map(index::getAnnotations).flatMap(Collection::stream).collect(Collectors.toList());
for (AnnotationInstance instance : annotations) {
SchemaResource resource = new SchemaResource();
resource.setName(instance.value().asString());
resource.setType(instance.name().withoutPackagePrefix().toLowerCase());
resource.setClassName(instance.target().asClass().name());
resources.add(resource);
}
BuildTimeJsonSchemaResolver resolver = new BuildTimeJsonSchemaResolver(resources);
BuildTimeCamelCatalog catalog = new BuildTimeCamelCatalog(resolver);
return new BuildTimeCamelCatalogBuildItem(catalog);
}
Aggregations