Class BeanDefinitionUtils


  • public abstract class BeanDefinitionUtils
    extends java.lang.Object
    BeanDefinition Utilities class
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    AbstractBeanDefinition, BeanDefinition.ROLE_APPLICATION, BeanDefinition.ROLE_INFRASTRUCTURE
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<java.lang.String> findBeanNames​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, java.util.function.Predicate<org.springframework.beans.factory.config.BeanDefinition> predicate)  
      static java.util.Set<java.lang.String> findInfrastructureBeanNames​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)  
      static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType)
      Build a generic instance of AbstractBeanDefinition
      static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType, int role)
      Build a generic instance of AbstractBeanDefinition
      static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType, int role, java.lang.Object[] constructorArguments)
      Build a generic instance of AbstractBeanDefinition
      static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType, java.lang.Object... constructorArguments)
      Build a generic instance of AbstractBeanDefinition
      static boolean isInfrastructureBean​(org.springframework.beans.factory.config.BeanDefinition beanDefinition)  
      static java.lang.Class<?> resolveBeanType​(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition)  
      static java.lang.Class<?> resolveBeanType​(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition, java.lang.ClassLoader classLoader)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanDefinitionUtils

        public BeanDefinitionUtils()
    • Method Detail

      • genericBeanDefinition

        public static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType)
        Build a generic instance of AbstractBeanDefinition
        Parameters:
        beanType - the type of bean
        Returns:
        an instance of AbstractBeanDefinition
      • genericBeanDefinition

        public static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType,
                                                                                                             java.lang.Object... constructorArguments)
        Build a generic instance of AbstractBeanDefinition
        Parameters:
        beanType - the type of bean
        constructorArguments - the arguments of Bean Classes' constructor
        Returns:
        an instance of AbstractBeanDefinition
      • genericBeanDefinition

        public static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType,
                                                                                                             int role)
        Build a generic instance of AbstractBeanDefinition
        Parameters:
        beanType - the type of bean
        role - the role of BeanDefinition
        Returns:
        an instance of AbstractBeanDefinition
      • genericBeanDefinition

        public static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition​(java.lang.Class<?> beanType,
                                                                                                             int role,
                                                                                                             java.lang.Object[] constructorArguments)
        Build a generic instance of AbstractBeanDefinition
        Parameters:
        beanType - the type of bean
        role - the role of BeanDefinition
        constructorArguments - the arguments of Bean Classes' constructor
        Returns:
        an instance of AbstractBeanDefinition
      • resolveBeanType

        public static java.lang.Class<?> resolveBeanType​(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition)
      • resolveBeanType

        public static java.lang.Class<?> resolveBeanType​(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
                                                         @Nullable
                                                         java.lang.ClassLoader classLoader)
      • findInfrastructureBeanNames

        public static java.util.Set<java.lang.String> findInfrastructureBeanNames​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
      • findBeanNames

        public static java.util.Set<java.lang.String> findBeanNames​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                                                                    java.util.function.Predicate<org.springframework.beans.factory.config.BeanDefinition> predicate)
      • isInfrastructureBean

        public static boolean isInfrastructureBean​(org.springframework.beans.factory.config.BeanDefinition beanDefinition)