类 AutoConfigurationPackages


  • public abstract class AutoConfigurationPackages
    extends Object
    Class for storing auto-configuration packages for reference later (e.g. by JPA entity scanner).
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型方法说明
      static List<String>get​(org.springframework.beans.factory.BeanFactory beanFactory)
      Return the auto-configuration base packages for the given bean factory.
      static booleanhas​(org.springframework.beans.factory.BeanFactory beanFactory)
      Determine if the auto-configuration base packages for the given bean factory are available.
      static voidregister​(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String... packageNames)
      Programmatically registers the auto-configuration package names.
    • 方法详细资料

      • has

        public static boolean has​(org.springframework.beans.factory.BeanFactory beanFactory)
        Determine if the auto-configuration base packages for the given bean factory are available.
        参数:
        beanFactory - the source bean factory
        返回:
        true if there are auto-config packages available
      • get

        public static List<Stringget​(org.springframework.beans.factory.BeanFactory beanFactory)
        Return the auto-configuration base packages for the given bean factory.
        参数:
        beanFactory - the source bean factory
        返回:
        a list of auto-configuration packages
        抛出:
        IllegalStateException - if auto-configuration is not enabled
      • register

        public static void register​(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
                                    String... packageNames)
        Programmatically registers the auto-configuration package names. Subsequent invocations will add the given package names to those that have already been registered. You can use this method to manually define the base packages that will be used for a given BeanDefinitionRegistry. Generally it's recommended that you don't call this method directly, but instead rely on the default convention where the package name is set from your @EnableAutoConfiguration configuration class or classes.
        参数:
        registry - the bean definition registry
        packageNames - the package names to set