use of org.mule.runtime.extension.api.annotation.PrivilegedExport in project mule by mulesoft.
the class JavaPrivilegedExportedTypesDeclarationEnricher method enrich.
@Override
public void enrich(ExtensionLoadingContext extensionLoadingContext) {
ExtensionDeclarer extensionDeclarer = extensionLoadingContext.getExtensionDeclarer();
extensionDeclarer.getDeclaration().getModelProperty(ExtensionTypeDescriptorModelProperty.class).map(ExtensionTypeDescriptorModelProperty::getType).flatMap(type -> type.getValueFromAnnotation(PrivilegedExport.class)).ifPresent(valueFetcher -> {
valueFetcher.getArrayValue(PrivilegedExport::artifacts).forEach(extensionDeclarer::withPrivilegedArtifact);
valueFetcher.getArrayValue(PrivilegedExport::packages).forEach(extensionDeclarer::withPrivilegedPackage);
});
}
Aggregations