Top Description Fields Constructors Methods
org.springframework.context.annotation

public Class ScannedGenericBeanDefinition

extends GenericBeanDefinition
implements AnnotatedBeanDefinition
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.annotation.AnnotatedBeanDefinition, org.springframework.beans.factory.config.BeanDefinition, org.springframework.beans.BeanMetadataElement, org.springframework.core.AttributeAccessor
Annotations
@SuppressWarnings:serial
Imports
org.springframework.beans.factory.annotation.AnnotatedBeanDefinition, .AnnotatedGenericBeanDefinition, org.springframework.beans.factory.support.GenericBeanDefinition, org.springframework.core.type.AnnotationMetadata, .MethodMetadata, org.springframework.core.type.classreading.MetadataReader, org.springframework.lang.Nullable, org.springframework.util.Assert

Extension of the org.springframework.beans.factory.support.GenericBeanDefinition class, based on an ASM ClassReader, with support for annotation metadata exposed through the AnnotatedBeanDefinition interface.

This class does not load the bean Class early. It rather retrieves all relevant metadata from the ".class" file itself, parsed with the ASM ClassReader. It is functionally equivalent to AnnotatedGenericBeanDefinition#AnnotatedGenericBeanDefinition(AnnotationMetadata) but distinguishes by type beans that have been scanned vs those that have been otherwise registered or detected by other means.

Authors
Juergen Hoeller, Chris Beams
Since
2.5
See Also
getMetadata(), getBeanClassName(), org.springframework.core.type.classreading.MetadataReaderFactory, AnnotatedGenericBeanDefinition

Field Summary

Modifier and TypeField and Description
private final AnnotationMetadata

Constructor Summary

AccessConstructor and Description
public
ScannedGenericBeanDefinition(MetadataReader
the MetadataReader for the scanned target class
metadataReader
)

Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.

Method Summary

Modifier and TypeMethod and Description
public MethodMetadata
getFactoryMethodMetadata()

Implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition.getFactoryMethodMetadata.

Obtain metadata for this bean definition's factory method, if any.

public final AnnotationMetadata
getMetadata()

Implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition.getMetadata.

Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.

Inherited from org.springframework.beans.factory.support.GenericBeanDefinition:
cloneBeanDefinitionequalsgetParentNamesetParentNametoString

Field Detail

metadataback to summary
private final AnnotationMetadata metadata

Constructor Detail

ScannedGenericBeanDefinitionback to summary
public ScannedGenericBeanDefinition(MetadataReader metadataReader)

Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.

Parameters
metadataReader:MetadataReader

the MetadataReader for the scanned target class

Method Detail

getFactoryMethodMetadataback to summary
public MethodMetadata getFactoryMethodMetadata()

Implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition.getFactoryMethodMetadata.

Doc from org.springframework.beans.factory.annotation.AnnotatedBeanDefinition.getFactoryMethodMetadata.

Obtain metadata for this bean definition's factory method, if any.

Returns:MethodMetadata

the factory method metadata, or null if none

Annotations
@Override
@Nullable
getMetadataback to summary
public final AnnotationMetadata getMetadata()

Implements org.springframework.beans.factory.annotation.AnnotatedBeanDefinition.getMetadata.

Doc from org.springframework.beans.factory.annotation.AnnotatedBeanDefinition.getMetadata.

Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.

Returns:AnnotationMetadata

the annotation metadata object (never null)

Annotations
@Override