Example usage for org.springframework.core.type AnnotationMetadata isIndependent

List of usage examples for org.springframework.core.type AnnotationMetadata isIndependent

Introduction

In this page you can find the example usage for org.springframework.core.type AnnotationMetadata isIndependent.

Prototype

boolean isIndependent();

Source Link

Document

Determine whether the underlying class is independent, i.e.

Usage

From source file:org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.java

/**
 * Determine whether the given bean definition qualifies as candidate.
 * <p>The default implementation checks whether the class is not an interface
 * and not dependent on an enclosing class.
 * <p>Can be overridden in subclasses.
 * @param beanDefinition the bean definition to check
 * @return whether the bean definition qualifies as a candidate component
 *//*from   w w w  .j a  v a  2s . co m*/
protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {
    AnnotationMetadata metadata = beanDefinition.getMetadata();
    return (metadata.isIndependent() && (metadata.isConcrete()
            || (metadata.isAbstract() && metadata.hasAnnotatedMethods(Lookup.class.getName()))));
}