Search in sources :

Example 1 with OutputTypeResolver

use of org.mule.runtime.api.metadata.resolving.OutputTypeResolver in project mule by mulesoft.

the class MetadataScopeAdapter method getCategoryName.

private String getCategoryName(Supplier<? extends OutputTypeResolver> outputResolver, Supplier<? extends AttributesTypeResolver> attributesResolver, Map<String, Supplier<? extends InputTypeResolver>> inputResolvers) {
    OutputTypeResolver outputTypeResolver = outputResolver.get();
    if (!(outputTypeResolver instanceof NullMetadataResolver)) {
        return outputTypeResolver.getCategoryName();
    }
    AttributesTypeResolver attributesTypeResolver = attributesResolver.get();
    if (!(attributesTypeResolver instanceof NullMetadataResolver)) {
        return attributesTypeResolver.getCategoryName();
    }
    for (Supplier<? extends InputTypeResolver> supplier : inputResolvers.values()) {
        InputTypeResolver inputTypeResolver = supplier.get();
        if (!(inputTypeResolver instanceof NullMetadataResolver)) {
            return inputTypeResolver.getCategoryName();
        }
    }
    throw new IllegalModelDefinitionException("Unable to create Keys Resolver. A Keys Resolver is being defined " + "without defining an Output Resolver, Input Resolver nor Attributes Resolver");
}
Also used : NullMetadataResolver(org.mule.runtime.extension.api.metadata.NullMetadataResolver) IllegalModelDefinitionException(org.mule.runtime.extension.api.exception.IllegalModelDefinitionException) OutputTypeResolver(org.mule.runtime.api.metadata.resolving.OutputTypeResolver) InputTypeResolver(org.mule.runtime.api.metadata.resolving.InputTypeResolver) AttributesTypeResolver(org.mule.runtime.api.metadata.resolving.AttributesTypeResolver)

Aggregations

AttributesTypeResolver (org.mule.runtime.api.metadata.resolving.AttributesTypeResolver)1 InputTypeResolver (org.mule.runtime.api.metadata.resolving.InputTypeResolver)1 OutputTypeResolver (org.mule.runtime.api.metadata.resolving.OutputTypeResolver)1 IllegalModelDefinitionException (org.mule.runtime.extension.api.exception.IllegalModelDefinitionException)1 NullMetadataResolver (org.mule.runtime.extension.api.metadata.NullMetadataResolver)1