Class AnnotatedGenericBeanDefinition

All Implemented Interfaces:
Serializable, Cloneable, BeanMetadataElement, AnnotatedBeanDefinition, BeanDefinition, AttributeAccessor

public class AnnotatedGenericBeanDefinition extends GenericBeanDefinition implements AnnotatedBeanDefinition
Extension of the 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 ScannedGenericBeanDefinition, which also implements the AnnotatedBeanDefinition interface).

Since:
2.5
Author:
Juergen Hoeller, Chris Beams
See Also:
  • Constructor Details

    • AnnotatedGenericBeanDefinition

      public AnnotatedGenericBeanDefinition(Class<?> beanClass)
      Create a new AnnotatedGenericBeanDefinition for the given bean class.
      Parameters:
      beanClass - the loaded bean class
    • AnnotatedGenericBeanDefinition

      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 - the annotation metadata for the bean class in question
      Since:
      3.1.1
    • AnnotatedGenericBeanDefinition

      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 - the annotation metadata for the bean class in question
      factoryMethodMetadata - metadata for the selected factory method
      Since:
      4.1.1
  • Method Details