Class ScannedGenericBeanDefinition
- java.lang.Object
- org.springframework.core.AttributeAccessorSupport
- org.springframework.beans.BeanMetadataAttributeAccessor
- org.springframework.beans.factory.support.AbstractBeanDefinition
- org.springframework.beans.factory.support.GenericBeanDefinition
- org.springframework.context.annotation.ScannedGenericBeanDefinition
- All Implemented Interfaces:
Serializable
,Cloneable
,BeanMetadataElement
,AnnotatedBeanDefinition
,BeanDefinition
,AttributeAccessor
public class ScannedGenericBeanDefinition extends GenericBeanDefinition implements AnnotatedBeanDefinition
Extension of theGenericBeanDefinition
class, based on an ASM ClassReader, with support for annotation metadata exposed through theAnnotatedBeanDefinition
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 toAnnotatedGenericBeanDefinition(AnnotationMetadata)
but distinguishes by type beans that have been scanned vs those that have been otherwise registered or detected by other means.- Since:
- 2.5
- Author:
- Juergen Hoeller, Chris Beams
- See Also:
getMetadata()
,AbstractBeanDefinition.getBeanClassName()
,MetadataReaderFactory
,AnnotatedGenericBeanDefinition
, Serialized Form
Field Summary
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, INFER_METHOD, SCOPE_DEFAULT
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON
Constructor Summary
Constructors Constructor Description ScannedGenericBeanDefinition(MetadataReader metadataReader)
Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodMetadata
getFactoryMethodMetadata()
Obtain metadata for this bean definition's factory method, if any.AnnotationMetadata
getMetadata()
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.Methods inherited from class org.springframework.beans.factory.support.GenericBeanDefinition
cloneBeanDefinition, equals, getParentName, setParentName, toString
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
addQualifier, applyDefaults, clone, copyQualifiersFrom, getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getInstanceSupplier, getLazyInit, getMethodOverrides, getOriginatingBeanDefinition, getPropertyValues, getQualifier, getQualifiers, getResolvableType, getResolvedAutowireMode, getResource, getResourceDescription, getRole, getScope, hasBeanClass, hasConstructorArgumentValues, hashCode, hasMethodOverrides, hasPropertyValues, hasQualifier, isAbstract, isAutowireCandidate, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isLenientConstructorResolution, isNonPublicAccessAllowed, isPrimary, isPrototype, isSingleton, isSynthetic, overrideFrom, prepareMethodOverride, prepareMethodOverrides, resolveBeanClass, setAbstract, setAutowireCandidate, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDescription, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setInstanceSupplier, setLazyInit, setLenientConstructorResolution, setMethodOverrides, setNonPublicAccessAllowed, setOriginatingBeanDefinition, setPrimary, setPropertyValues, setResource, setResourceDescription, setRole, setScope, setSynthetic, validate
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource
Methods inherited from class org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, hasAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface org.springframework.beans.factory.config.BeanDefinition
getBeanClassName, getConstructorArgumentValues, getDependsOn, getDescription, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getOriginatingBeanDefinition, getParentName, getPropertyValues, getResolvableType, getResourceDescription, getRole, getScope, hasConstructorArgumentValues, hasPropertyValues, isAbstract, isAutowireCandidate, isLazyInit, isPrimary, isPrototype, isSingleton, setAutowireCandidate, setBeanClassName, setDependsOn, setDescription, setDestroyMethodName, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setParentName, setPrimary, setRole, setScope
Methods inherited from interface org.springframework.beans.BeanMetadataElement
getSource
Constructor Detail
ScannedGenericBeanDefinition
public ScannedGenericBeanDefinition(MetadataReader metadataReader)
Create a new ScannedGenericBeanDefinition for the class that the given MetadataReader describes.- Parameters:
metadataReader
- the MetadataReader for the scanned target class
Method Detail
getMetadata
public final AnnotationMetadata getMetadata()
Description copied from interface:AnnotatedBeanDefinition
Obtain the annotation metadata (as well as basic class metadata) for this bean definition's bean class.- Specified by:
getMetadata
in interfaceAnnotatedBeanDefinition
- Returns:
- the annotation metadata object (never
null
)
getFactoryMethodMetadata
@Nullable public MethodMetadata getFactoryMethodMetadata()
Description copied from interface:AnnotatedBeanDefinition
Obtain metadata for this bean definition's factory method, if any.- Specified by:
getFactoryMethodMetadata
in interfaceAnnotatedBeanDefinition
- Returns:
- the factory method metadata, or
null
if none