Top Description Fields Constructors Methods
org.springframework.beans.factory.annotation

public Class AnnotatedGenericBeanDefinition

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.support.GenericBeanDefinition, org.springframework.core.type.AnnotationMetadata, .MethodMetadata, .StandardAnnotationMetadata, org.springframework.lang.Nullable, org.springframework.util.Assert

Extension of the org.springframework.beans.factory.support.GenericBeanDefinition class, adding support for annotation metadata exposed through the AnnotatedBeanDefinition interface.

This GenericBeanDefinition variant is mainly useful for testing code that expects to operate on an AnnotatedBeanDefinition, for example strategy implementations in Spring's component scanning support (where the default definition class is org.springframework.context.annotation.ScannedGenericBeanDefinition, which also implements the AnnotatedBeanDefinition interface).

Authors
Juergen Hoeller, Chris Beams
Since
2.5
See Also
AnnotatedBeanDefinition#getMetadata(), org.springframework.core.type.StandardAnnotationMetadata

Field Summary

Modifier and TypeField and Description
private MethodMetadata
private final AnnotationMetadata

Constructor Summary

AccessConstructor and Description
public
AnnotatedGenericBeanDefinition(Class<?>
the loaded bean class
beanClass
)

Create a new AnnotatedGenericBeanDefinition for the given bean class.

public
AnnotatedGenericBeanDefinition(AnnotationMetadata
the annotation metadata for the bean class in question
metadata
)

Create a new AnnotatedGenericBeanDefinition for the given annotation metadata, allowing for ASM-based processing and avoidance of early loading of the bean class.

public
AnnotatedGenericBeanDefinition(AnnotationMetadata
the annotation metadata for the bean class in question
metadata
,
MethodMetadata
metadata for the selected factory method
factoryMethodMetadata
)

Create a new AnnotatedGenericBeanDefinition for the given annotation metadata, based on an annotated class and a factory method on that class.

Method Summary

Modifier and TypeMethod and Description
public final 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

factoryMethodMetadataback to summary
private MethodMetadata factoryMethodMetadata
Annotations
@Nullable
metadataback to summary
private final AnnotationMetadata metadata

Constructor Detail

AnnotatedGenericBeanDefinitionback to summary
public AnnotatedGenericBeanDefinition(Class<?> beanClass)

Create a new AnnotatedGenericBeanDefinition for the given bean class.

Parameters
beanClass:Class<?>

the loaded bean class

AnnotatedGenericBeanDefinitionback to summary
public AnnotatedGenericBeanDefinition(AnnotationMetadata metadata)

Create a new AnnotatedGenericBeanDefinition for the given annotation metadata, allowing for ASM-based processing and avoidance of early loading of the bean class. Note that this constructor is functionally equivalent to ScannedGenericBeanDefinition, however the semantics of the latter indicate that a bean was discovered specifically via component-scanning as opposed to other means.

Parameters
metadata:AnnotationMetadata

the annotation metadata for the bean class in question

Since
3.1.1
AnnotatedGenericBeanDefinitionback to summary
public AnnotatedGenericBeanDefinition(AnnotationMetadata metadata, MethodMetadata factoryMethodMetadata)

Create a new AnnotatedGenericBeanDefinition for the given annotation metadata, based on an annotated class and a factory method on that class.

Parameters
metadata:AnnotationMetadata

the annotation metadata for the bean class in question

factoryMethodMetadata:MethodMetadata

metadata for the selected factory method

Since
4.1.1

Method Detail

getFactoryMethodMetadataback to summary
public final 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