Class AutoConfigurationPackages
java.lang.Object
org.springframework.boot.autoconfigure.AutoConfigurationPackages
Class for storing auto-configuration packages for reference later (e.g. by JPA entity
scanner).
- Since:
- 1.0.0
- Author:
- Phillip Webb, Dave Syer, Oliver Gierke
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget
(BeanFactory beanFactory) Return the auto-configuration base packages for the given bean factory.static boolean
has
(BeanFactory beanFactory) Determine if the auto-configuration base packages for the given bean factory are available.static void
register
(BeanDefinitionRegistry registry, String... packageNames) Programmatically registers the auto-configuration package names.
-
Constructor Details
-
AutoConfigurationPackages
public AutoConfigurationPackages()
-
-
Method Details
-
has
Determine if the auto-configuration base packages for the given bean factory are available.- Parameters:
beanFactory
- the source bean factory- Returns:
- true if there are auto-config packages available
-
get
Return the auto-configuration base packages for the given bean factory.- Parameters:
beanFactory
- the source bean factory- Returns:
- a list of auto-configuration packages
- Throws:
IllegalStateException
- if auto-configuration is not enabled
-
register
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 givenBeanDefinitionRegistry
. 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.- Parameters:
registry
- the bean definition registrypackageNames
- the package names to set
-