use of org.mule.runtime.module.extension.internal.loader.java.property.CompileTimeModelProperty in project mule by mulesoft.
the class DefaultJavaModelLoaderDelegate method declare.
/**
* {@inheritDoc}
*/
@Override
public ExtensionDeclarer declare(ExtensionLoadingContext context) {
ExtensionDeclarer declarer = context.getExtensionDeclarer().named(extensionElement.getName()).onVersion(version).fromVendor(extensionElement.getVendor()).withCategory(extensionElement.getCategory()).withModelProperty(new ExtensionTypeDescriptorModelProperty(extensionElement));
// TODO MULE-14517: This workaround should be replaced for a better and more complete mechanism
context.getParameter("COMPILATION_MODE").ifPresent(m -> declarer.withModelProperty(new CompileTimeModelProperty()));
extensionElement.getDeclaringClass().ifPresent(extensionClass -> declarer.withModelProperty(new ImplementingTypeModelProperty(extensionClass)));
processLicenseRequirements(declarer);
parseExternalLibs(extensionElement, declarer);
addExceptionEnricher(extensionElement, declarer);
configLoaderDelegate.declareConfigurations(declarer, extensionElement);
connectionProviderModelLoaderDelegate.declareConnectionProviders(declarer, extensionElement);
if (!isEmpty(extensionElement.getConfigurations())) {
operationLoaderDelegate.declareOperations(declarer, declarer, null, extensionElement.getOperations(), false);
functionModelLoaderDelegate.declareFunctions(declarer, declarer, null, extensionElement.getFunctions());
extensionElement.getSources().forEach(source -> sourceModelLoaderDelegate.declareMessageSource(declarer, declarer, source, false));
}
return declarer;
}
Aggregations