Search in sources :

Example 1 with Example

use of org.mule.runtime.extension.api.annotation.param.display.Example in project mule by mulesoft.

the class DisplayDeclarationEnricher method enrichDeclaration.

private void enrichDeclaration(BaseDeclaration declaration, WithAnnotations annotatedElement) {
    if (annotatedElement != null) {
        final Summary summaryAnnotation = annotatedElement.getAnnotation(Summary.class).orElse(null);
        final DisplayName displayNameAnnotation = annotatedElement.getAnnotation(DisplayName.class).orElse(null);
        final Example exampleAnnotation = annotatedElement.getAnnotation(Example.class).orElse(null);
        final Path pathAnnotation = annotatedElement.getAnnotation(Path.class).orElse(null);
        final ClassValue classValue = annotatedElement.getAnnotation(ClassValue.class).orElse(null);
        createDisplayModelProperty(declaration, summaryAnnotation, displayNameAnnotation, exampleAnnotation, pathAnnotation, classValue);
    }
}
Also used : Path(org.mule.runtime.extension.api.annotation.param.display.Path) ClassValue(org.mule.runtime.extension.api.annotation.param.display.ClassValue) Example(org.mule.runtime.extension.api.annotation.param.display.Example) DisplayName(org.mule.runtime.extension.api.annotation.param.display.DisplayName) Summary(org.mule.runtime.extension.api.annotation.param.display.Summary)

Example 2 with Example

use of org.mule.runtime.extension.api.annotation.param.display.Example in project mule by mulesoft.

the class DisplayDeclarationEnricher method enrichTypes.

private void enrichTypes(BaseDeclaration declaration) {
    final Optional<ImplementingTypeModelProperty> modelProperty = declaration.getModelProperty(ImplementingTypeModelProperty.class);
    if (modelProperty.isPresent()) {
        final Class<?> annotatedType = modelProperty.get().getType();
        final Summary summaryAnnotation = getAnnotation(annotatedType, Summary.class);
        final DisplayName displayNameAnnotation = getAnnotation(annotatedType, DisplayName.class);
        final Example exampleAnnotation = getAnnotation(annotatedType, Example.class);
        final Path pathAnnotation = getAnnotation(annotatedType, Path.class);
        final ClassValue classAnnotation = getAnnotation(annotatedType, ClassValue.class);
        createDisplayModelProperty(declaration, summaryAnnotation, displayNameAnnotation, exampleAnnotation, pathAnnotation, classAnnotation);
    }
}
Also used : Path(org.mule.runtime.extension.api.annotation.param.display.Path) ClassValue(org.mule.runtime.extension.api.annotation.param.display.ClassValue) Example(org.mule.runtime.extension.api.annotation.param.display.Example) DisplayName(org.mule.runtime.extension.api.annotation.param.display.DisplayName) Summary(org.mule.runtime.extension.api.annotation.param.display.Summary) ImplementingTypeModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ImplementingTypeModelProperty)

Aggregations

ClassValue (org.mule.runtime.extension.api.annotation.param.display.ClassValue)2 DisplayName (org.mule.runtime.extension.api.annotation.param.display.DisplayName)2 Example (org.mule.runtime.extension.api.annotation.param.display.Example)2 Path (org.mule.runtime.extension.api.annotation.param.display.Path)2 Summary (org.mule.runtime.extension.api.annotation.param.display.Summary)2 ImplementingTypeModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ImplementingTypeModelProperty)1