org.springframework.context.annotation

Class AnnotatedBeanDefinitionReader

  • java.lang.Object
    • org.springframework.context.annotation.AnnotatedBeanDefinitionReader
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      BeanDefinitionRegistry getRegistry()
      Return the BeanDefinitionRegistry that this scanner operates on.
      void register(java.lang.Class<?>... annotatedClasses)
      Register one or more annotated classes to be processed.
      void registerBean(java.lang.Class<?> annotatedClass)
      Register a bean from the given bean class, deriving its metadata from class-declared annotations.
      void registerBean(java.lang.Class<?> annotatedClass, java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
      Register a bean from the given bean class, deriving its metadata from class-declared annotations.
      void registerBean(java.lang.Class<?> annotatedClass, java.lang.String name, java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
      Register a bean from the given bean class, deriving its metadata from class-declared annotations.
      <T> void registerBean(java.lang.Class<T> annotatedClass, java.lang.String name, java.util.function.Supplier<T> instanceSupplier)
      Register a bean from the given bean class, deriving its metadata from class-declared annotations, using the given supplier for obtaining a new instance (possibly declared as a lambda expression or method reference).
      <T> void registerBean(java.lang.Class<T> annotatedClass, java.util.function.Supplier<T> instanceSupplier)
      Register a bean from the given bean class, deriving its metadata from class-declared annotations, using the given supplier for obtaining a new instance (possibly declared as a lambda expression or method reference).
      void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
      Set the BeanNameGenerator to use for detected bean classes.
      void setEnvironment(Environment environment)
      Set the Environment to use when evaluating whether @Conditional-annotated component classes should be registered.
      void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
      Set the ScopeMetadataResolver to use for detected bean classes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRegistry

        public final BeanDefinitionRegistry getRegistry()
        Return the BeanDefinitionRegistry that this scanner operates on.
      • register

        public void register(java.lang.Class<?>... annotatedClasses)
        Register one or more annotated classes to be processed.

        Calls to register are idempotent; adding the same annotated class more than once has no additional effect.

        Parameters:
        annotatedClasses - one or more annotated classes, e.g. @Configuration classes
      • registerBean

        public void registerBean(java.lang.Class<?> annotatedClass)
        Register a bean from the given bean class, deriving its metadata from class-declared annotations.
        Parameters:
        annotatedClass - the class of the bean
      • registerBean

        public <T> void registerBean(java.lang.Class<T> annotatedClass,
                                     @Nullable
                                     java.util.function.Supplier<T> instanceSupplier)
        Register a bean from the given bean class, deriving its metadata from class-declared annotations, using the given supplier for obtaining a new instance (possibly declared as a lambda expression or method reference).
        Parameters:
        annotatedClass - the class of the bean
        instanceSupplier - a callback for creating an instance of the bean (may be null)
        Since:
        5.0
      • registerBean

        public <T> void registerBean(java.lang.Class<T> annotatedClass,
                                     java.lang.String name,
                                     @Nullable
                                     java.util.function.Supplier<T> instanceSupplier)
        Register a bean from the given bean class, deriving its metadata from class-declared annotations, using the given supplier for obtaining a new instance (possibly declared as a lambda expression or method reference).
        Parameters:
        annotatedClass - the class of the bean
        name - an explicit name for the bean
        instanceSupplier - a callback for creating an instance of the bean (may be null)
        Since:
        5.0
      • registerBean

        public void registerBean(java.lang.Class<?> annotatedClass,
                                 java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
        Register a bean from the given bean class, deriving its metadata from class-declared annotations.
        Parameters:
        annotatedClass - the class of the bean
        qualifiers - specific qualifier annotations to consider, in addition to qualifiers at the bean class level
      • registerBean

        public void registerBean(java.lang.Class<?> annotatedClass,
                                 java.lang.String name,
                                 java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
        Register a bean from the given bean class, deriving its metadata from class-declared annotations.
        Parameters:
        annotatedClass - the class of the bean
        name - an explicit name for the bean
        qualifiers - specific qualifier annotations to consider, in addition to qualifiers at the bean class level