Interface AnnotationConfigRegistry

All Known Implementing Classes:
AnnotationConfigApplicationContext, AnnotationConfigWebApplicationContext

public interface AnnotationConfigRegistry
Common interface for annotation config application contexts, defining register(org.springframework.beans.factory.BeanRegistrar...) and scan(java.lang.String...) methods.
Since:
4.1
Author:
Juergen Hoeller
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(Class<?>... componentClasses)
    Register one or more component classes to be processed, inferring annotation-based characteristics for primary/fallback/lazy-init just like for scanned component classes.
    void
    register(BeanRegistrar... registrars)
    Invoke the given registrars for registering their beans with this application context.
    void
    scan(String... basePackages)
    Perform a scan within the specified base packages.
  • Method Details

    • register

      void register(BeanRegistrar... registrars)
      Invoke the given registrars for registering their beans with this application context.

      This can be used to register custom beans without inferring annotation-based characteristics for primary/fallback/lazy-init, rather specifying those programmatically if needed.

      Parameters:
      registrars - one or more BeanRegistrar instances
      Since:
      7.0
      See Also:
    • register

      void register(Class<?>... componentClasses)
      Register one or more component classes to be processed, inferring annotation-based characteristics for primary/fallback/lazy-init just like for scanned component classes.

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

      Parameters:
      componentClasses - one or more component classes, for example, @Configuration classes
      See Also:
    • scan

      void scan(String... basePackages)
      Perform a scan within the specified base packages.
      Parameters:
      basePackages - the packages to scan for component classes
      See Also: