Class BeanDefinitionUtils
java.lang.Object
org.axonframework.extension.spring.BeanDefinitionUtils
Utility methods for working with Spring
BeanDefinitions.- Since:
- 5.0.2
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractPackageName(org.springframework.beans.factory.config.BeanDefinition definition) Extracts the package name from the given bean definition's class name.resolveClassName(org.springframework.beans.factory.config.BeanDefinition definition) Resolves the fully qualified class name from a bean definition.
-
Method Details
-
extractPackageName
@Nonnull public static String extractPackageName(@Nonnull org.springframework.beans.factory.config.BeanDefinition definition) Extracts the package name from the given bean definition's class name.This method attempts to determine the package name by examining the bean definition in the following order:
- The bean class name from
BeanDefinition.getBeanClassName() - For
AbstractBeanDefinition, the bean class if available - For
AnnotatedBeanDefinition, the metadata class name
- Parameters:
definition- The bean definition to extract the package name from.- Returns:
- The package name, or "default" if the package cannot be determined.
- The bean class name from
-
resolveClassName
@Nonnull public static Optional<String> resolveClassName(@Nonnull org.springframework.beans.factory.config.BeanDefinition definition) Resolves the fully qualified class name from a bean definition.Attempts multiple strategies to obtain the class name, returning the first non-null value.
- Parameters:
definition- The bean definition to resolve the class name from.- Returns:
- An Optional containing the fully qualified class name, or empty if it cannot be determined.
-