接口 AnnotationConfigRegistry

所有已知实现类:
AnnotationConfigApplicationContext, StandardApplicationContext

public interface AnnotationConfigRegistry
Common interface for annotation config application contexts, defining register(Class[]) and scan(String...) methods.
从以下版本开始:
4.0
作者:
TODAY 2021/9/30 23:06
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    register(Class<?>... components)
    Register one or more component classes to be processed.
    void
    scan(String... basePackages)
    Perform a scan within the specified base packages.
  • 方法详细资料

    • register

      void register(Class<?>... components)
      Register one or more component classes to be processed.

      Calls to register are idempotent; adding the same component class more than once has no additional effect. Load Import beans from input components classes

      参数:
      components - one or more component classes, e.g. @Configuration classes
      从以下版本开始:
      4.0
    • scan

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