Search in sources :

Example 1 with AttributesJsonType

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

the class CustomStaticTypeDeclarationEnricher method getAttributesType.

private Optional<MetadataType> getAttributesType(AnnotatedElement element) {
    AttributesXmlType xml = element.getAnnotation(AttributesXmlType.class);
    if (xml != null) {
        return getXmlType(xml.schema(), xml.qname());
    }
    AttributesJsonType json = element.getAnnotation(AttributesJsonType.class);
    if (json != null) {
        return getJsonType(json.schema());
    }
    OutputResolver resolver = element.getAnnotation(OutputResolver.class);
    if (resolver != null && isStaticResolver(resolver.attributes())) {
        return getCustomStaticType(resolver.attributes());
    }
    MetadataScope scope = element.getAnnotation(MetadataScope.class);
    if (scope != null && isStaticResolver(scope.attributesResolver())) {
        return getCustomStaticType(scope.attributesResolver());
    }
    return empty();
}
Also used : AttributesXmlType(org.mule.runtime.extension.api.annotation.metadata.fixed.AttributesXmlType) OutputResolver(org.mule.runtime.extension.api.annotation.metadata.OutputResolver) AttributesJsonType(org.mule.runtime.extension.api.annotation.metadata.fixed.AttributesJsonType) 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 AttributesJsonType (org.mule.runtime.extension.api.annotation.metadata.fixed.AttributesJsonType)1 AttributesXmlType (org.mule.runtime.extension.api.annotation.metadata.fixed.AttributesXmlType)1