use of org.mule.runtime.extension.api.annotation.Export in project mule by mulesoft.
the class JavaExportedTypesDeclarationEnricher method enrich.
@Override
public void enrich(ExtensionLoadingContext extensionLoadingContext) {
Optional<ExtensionTypeDescriptorModelProperty> modelProperty = extensionLoadingContext.getExtensionDeclarer().getDeclaration().getModelProperty(ExtensionTypeDescriptorModelProperty.class);
modelProperty.map(ExtensionTypeDescriptorModelProperty::getType).flatMap(type -> type.getValueFromAnnotation(Export.class)).ifPresent(exportAnnotation -> {
ExtensionDeclarer declarer = extensionLoadingContext.getExtensionDeclarer();
exportAnnotation.getClassArrayValue(Export::classes).stream().map(Type::asMetadataType).forEach(type -> registerType(declarer, type));
exportAnnotation.getArrayValue(Export::resources).forEach(declarer::withResource);
});
}
Aggregations