Search in sources :

Example 1 with ImplementingParameterModelProperty

use of org.mule.runtime.module.extension.internal.loader.java.property.ImplementingParameterModelProperty in project mule by mulesoft.

the class IntrospectionUtils method getAnnotatedElement.

public static java.util.Optional<AnnotatedElement> getAnnotatedElement(BaseDeclaration<?> declaration) {
    final java.util.Optional<DeclaringMemberModelProperty> declaringMember = declaration.getModelProperty(DeclaringMemberModelProperty.class);
    final java.util.Optional<ImplementingParameterModelProperty> implementingParameter = declaration.getModelProperty(ImplementingParameterModelProperty.class);
    AnnotatedElement annotatedElement = null;
    if (declaringMember.isPresent()) {
        annotatedElement = declaringMember.get().getDeclaringField();
    }
    if (implementingParameter.isPresent()) {
        annotatedElement = implementingParameter.get().getParameter();
    }
    return java.util.Optional.ofNullable(annotatedElement);
}
Also used : DeclaringMemberModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.DeclaringMemberModelProperty) AnnotatedElement(java.lang.reflect.AnnotatedElement) ImplementingParameterModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.ImplementingParameterModelProperty)

Aggregations

AnnotatedElement (java.lang.reflect.AnnotatedElement)1 DeclaringMemberModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.DeclaringMemberModelProperty)1 ImplementingParameterModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.ImplementingParameterModelProperty)1