public abstract class BeanUtils
extends java.lang.Object
| 构造器 | 说明 |
|---|---|
BeanUtils() |
| 修饰符和类型 | 方法 | 说明 |
|---|---|---|
protected static java.util.Set<java.lang.String> |
doGetBeanNames(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
java.lang.Class<?> beanType) |
Get Bean names from
ConfigurableListableBeanFactory by type |
static java.lang.String[] |
getBeanNames(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
java.lang.Class<?> beanClass) |
Get Bean Names from
ConfigurableListableBeanFactory by type. |
static java.lang.String[] |
getBeanNames(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
java.lang.Class<?> beanClass,
boolean includingAncestors) |
Get Bean Names from
ConfigurableListableBeanFactory by type. |
static java.lang.String[] |
getBeanNames(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass) |
Get Bean Names from
ListableBeanFactory by type. |
static java.lang.String[] |
getBeanNames(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass,
boolean includingAncestors) |
Get Bean Names from
ListableBeanFactory by type. |
static <T> T |
getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<T> beanClass) |
Get Optional Bean by
Class. |
static <T> T |
getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<T> beanClass,
boolean includingAncestors) |
Get Optional Bean by
Class including ancestors(BeanFactory). |
static <T> java.util.List<T> |
getSortedBeans(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<T> type) |
Get all sorted Beans of
ListableBeanFactory in specified bean type. |
static boolean |
isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass) |
Is Bean Present or not?
|
static boolean |
isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass,
boolean includingAncestors) |
Is Bean Present or not?
|
static boolean |
isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.String beanClassName) |
Is Bean Present or not?
|
static boolean |
isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.String beanClassName,
boolean includingAncestors) |
Is Bean Present or not?
|
static java.lang.Class<?> |
resolveBeanType(java.lang.String beanClassName,
java.lang.ClassLoader classLoader) |
Resolve Bean Type
|
static <T> java.util.Map<java.lang.String,T> |
sort(java.util.Map<java.lang.String,T> beansMap) |
Sort Beans
Map via AnnotationAwareOrderComparator.sort(List) rule |
public static boolean isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass)
beanFactory - ListableBeanFactorybeanClass - The Class of Beantrue , or falsepublic static boolean isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass,
boolean includingAncestors)
beanFactory - ListableBeanFactorybeanClass - The Class of BeanincludingAncestors - including ancestors or nottrue , or falsepublic static boolean isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.String beanClassName,
boolean includingAncestors)
beanFactory - ListableBeanFactorybeanClassName - The name of Class of BeanincludingAncestors - including ancestors or nottrue , or falsepublic static boolean isBeanPresent(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.String beanClassName)
beanFactory - ListableBeanFactorybeanClassName - The name of Class of Beantrue , or falsepublic static java.lang.String[] getBeanNames(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
java.lang.Class<?> beanClass)
ConfigurableListableBeanFactory by type.beanFactory - ConfigurableListableBeanFactorybeanClass - The Class of Beanpublic static java.lang.String[] getBeanNames(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
java.lang.Class<?> beanClass,
boolean includingAncestors)
ConfigurableListableBeanFactory by type.beanFactory - ConfigurableListableBeanFactorybeanClass - The Class of BeanincludingAncestors - including ancestors or notpublic static java.lang.String[] getBeanNames(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass)
ListableBeanFactory by type.beanFactory - ListableBeanFactorybeanClass - The Class of Beanpublic static java.lang.String[] getBeanNames(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<?> beanClass,
boolean includingAncestors)
ListableBeanFactory by type.beanFactory - ListableBeanFactorybeanClass - The Class of BeanincludingAncestors - including ancestors or notprotected static java.util.Set<java.lang.String> doGetBeanNames(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
java.lang.Class<?> beanType)
ConfigurableListableBeanFactory by typebeanFactory - ConfigurableListableBeanFactorybeanType - The type of Beanpublic static java.lang.Class<?> resolveBeanType(java.lang.String beanClassName,
java.lang.ClassLoader classLoader)
beanClassName - the class name of BeanclassLoader - ClassLoadernull.public static <T> T getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<T> beanClass,
boolean includingAncestors)
throws org.springframework.beans.BeansException
Class including ancestors(BeanFactory).T - The Class of BeanbeanFactory - ListableBeanFactorybeanClass - The Class of BeanincludingAncestors - including ancestors or notnull.org.springframework.beans.factory.NoUniqueBeanDefinitionException - if more than one bean of the given type was foundorg.springframework.beans.BeansExceptionBeanFactoryUtils.beanOfTypeIncludingAncestors(ListableBeanFactory, Class)public static <T> T getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<T> beanClass)
throws org.springframework.beans.BeansException
Class.T - The Class of BeanbeanFactory - ListableBeanFactorybeanClass - The Class of Beannull.org.springframework.beans.factory.NoUniqueBeanDefinitionException - if more than one bean of the given type was foundorg.springframework.beans.BeansExceptionpublic static <T> java.util.List<T> getSortedBeans(org.springframework.beans.factory.ListableBeanFactory beanFactory,
java.lang.Class<T> type)
ListableBeanFactory in specified bean type.T - bean typebeanFactory - ListableBeanFactorytype - bean typepublic static <T> java.util.Map<java.lang.String,T> sort(java.util.Map<java.lang.String,T> beansMap)
Map via AnnotationAwareOrderComparator.sort(List) ruleT - the type of BeanbeansMap - Beans MapMapCopyright © 2018. All rights reserved.