Search in sources :

Example 1 with OutputJsonType

use of org.mule.runtime.extension.api.annotation.metadata.fixed.OutputJsonType in project mule by mulesoft.

the class CustomStaticTypeDeclarationEnricher method getOutputType.

private Optional<MetadataType> getOutputType(AnnotatedElement element) {
    OutputXmlType xml = element.getAnnotation(OutputXmlType.class);
    if (xml != null) {
        return getXmlType(xml.schema(), xml.qname());
    }
    OutputJsonType json = element.getAnnotation(OutputJsonType.class);
    if (json != null) {
        return getJsonType(json.schema());
    }
    OutputResolver resolver = element.getAnnotation(OutputResolver.class);
    if (resolver != null && isStaticResolver(resolver.output())) {
        return getCustomStaticType(resolver.output());
    }
    MetadataScope scope = element.getAnnotation(MetadataScope.class);
    if (scope != null && isStaticResolver(scope.outputResolver())) {
        return getCustomStaticType(scope.outputResolver());
    }
    return empty();
}
Also used : OutputResolver(org.mule.runtime.extension.api.annotation.metadata.OutputResolver) OutputJsonType(org.mule.runtime.extension.api.annotation.metadata.fixed.OutputJsonType) OutputXmlType(org.mule.runtime.extension.api.annotation.metadata.fixed.OutputXmlType) MetadataScope(org.mule.runtime.extension.api.annotation.metadata.MetadataScope)

Aggregations

MetadataScope (org.mule.runtime.extension.api.annotation.metadata.MetadataScope)1 OutputResolver (org.mule.runtime.extension.api.annotation.metadata.OutputResolver)1 OutputJsonType (org.mule.runtime.extension.api.annotation.metadata.fixed.OutputJsonType)1 OutputXmlType (org.mule.runtime.extension.api.annotation.metadata.fixed.OutputXmlType)1