Package io.microsphere.spring.util
Class BeanDefinitionUtils
- java.lang.Object
-
- io.microsphere.spring.util.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
-
-
Constructor Summary
Constructors Constructor Description BeanDefinitionUtils()
-
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 ofAbstractBeanDefinition
static org.springframework.beans.factory.support.AbstractBeanDefinition
genericBeanDefinition(java.lang.Class<?> beanType, int role)
Build a generic instance ofAbstractBeanDefinition
static org.springframework.beans.factory.support.AbstractBeanDefinition
genericBeanDefinition(java.lang.Class<?> beanType, int role, java.lang.Object[] constructorArguments)
Build a generic instance ofAbstractBeanDefinition
static org.springframework.beans.factory.support.AbstractBeanDefinition
genericBeanDefinition(java.lang.Class<?> beanType, java.lang.Object... constructorArguments)
Build a generic instance ofAbstractBeanDefinition
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)
-
-
-
Method Detail
-
genericBeanDefinition
public static org.springframework.beans.factory.support.AbstractBeanDefinition genericBeanDefinition(java.lang.Class<?> beanType)
Build a generic instance ofAbstractBeanDefinition
- 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 ofAbstractBeanDefinition
- Parameters:
beanType
- the type of beanconstructorArguments
- 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 ofAbstractBeanDefinition
- Parameters:
beanType
- the type of beanrole
- the role ofBeanDefinition
- 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 ofAbstractBeanDefinition
- Parameters:
beanType
- the type of beanrole
- the role ofBeanDefinition
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)
-
-