use of org.mule.runtime.module.extension.api.loader.java.type.WithDeclaringClass in project mule by mulesoft.
the class MetadataScopeAdapter method initializeFromClass.
private void initializeFromClass(Type extensionType, WithDeclaringClass annotatedType, WithOutputDeclaration declaration) {
// TODO MULE-10891: Add support for Source Callback parameters
Optional<Class<?>> extensionClass = extensionType.getDeclaringClass();
Optional<Class<?>> componentClass = annotatedType.getDeclaringClass();
if (componentClass.isPresent() && extensionClass.isPresent()) {
MetadataScope scope = getAnnotation(componentClass.get(), MetadataScope.class);
scope = scope != null ? scope : getAnnotation(extensionClass.get(), MetadataScope.class);
if (scope != null && !hasCustomStaticType(declaration.getOutput())) {
this.keysResolver = ResolverSupplier.of(scope.keysResolver());
this.outputResolver = ResolverSupplier.of(scope.outputResolver());
this.attributesResolver = ResolverSupplier.of(scope.attributesResolver());
}
}
}
Aggregations