Example usage for org.springframework.core MethodParameter getAnnotatedElement

List of usage examples for org.springframework.core MethodParameter getAnnotatedElement

Introduction

In this page you can find the example usage for org.springframework.core MethodParameter getAnnotatedElement.

Prototype

public AnnotatedElement getAnnotatedElement() 

Source Link

Document

Return the wrapped annotated element.

Usage

From source file:com.payu.ratel.client.ContextAnnotationAutowireCandidateResolver.java

protected boolean isLazy(DependencyDescriptor descriptor) {
    for (Annotation ann : descriptor.getAnnotations()) {
        Lazy lazy = AnnotationUtils.getAnnotation(ann, Lazy.class);
        if (lazy != null && lazy.value()) {
            return true;
        }/*ww w  .j  a v a2 s .c  om*/
    }
    MethodParameter methodParam = descriptor.getMethodParameter();
    if (methodParam == null) {
        return false;
    }
    Method method = methodParam.getMethod();
    if (method == null || void.class.equals(method.getReturnType())) {
        Lazy lazy = AnnotationUtils.getAnnotation(methodParam.getAnnotatedElement(), Lazy.class);
        if (lazy != null && lazy.value()) {
            return true;
        }
    }

    return false;
}