类 ConfigurationPropertiesBean
java.lang.Object
cn.taketoday.context.properties.ConfigurationPropertiesBean
Provides access to
@ConfigurationProperties bean
details, regardless of if the annotation was used directly or on a @Bean
factory method. This class can be used to access all configuration properties beans in an ApplicationContext, or
individual beans on a case-by-case
basis (for example, in a BeanPostProcessor).- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static enumThe binding method that is used for the bean. -
方法概要
修饰符和类型方法说明Bindable<?>static ConfigurationPropertiesBeanget(ApplicationContext applicationContext, Object bean, String beanName) Return a@ConfigurationPropertiesBeaninstance for the given bean details ornullif the bean is not a@ConfigurationPropertiesobject.static Map<String,ConfigurationPropertiesBean> getAll(ApplicationContext applicationContext) Return all@ConfigurationPropertiesbeans contained in the given application context.Return theConfigurationPropertiesannotation for the bean.Return the property binding method that was used for the bean.Return the actual Framework bean instance.getName()Return the name of the Framework bean.
-
方法详细资料
-
getName
Return the name of the Framework bean.- 返回:
- the bean name
-
getInstance
Return the actual Framework bean instance.- 返回:
- the bean instance
-
getBindMethod
Return the property binding method that was used for the bean.- 返回:
- the bind type
-
getAnnotation
Return theConfigurationPropertiesannotation for the bean. The annotation may be defined on the bean itself or from the factory method that create the bean (usually a@Beanmethod).- 返回:
- the configuration properties annotation
-
asBindTarget
- 返回:
- a bind target for use with the
Binder
-
getAll
Return all@ConfigurationPropertiesbeans contained in the given application context. Both directly annotated beans, as well as beans that have@ConfigurationPropertiesannotated factory methods are included.- 参数:
applicationContext- the source application context- 返回:
- a map of all configuration properties beans keyed by the bean name
-
get
@Nullable public static ConfigurationPropertiesBean get(ApplicationContext applicationContext, Object bean, String beanName) Return a@ConfigurationPropertiesBeaninstance for the given bean details ornullif the bean is not a@ConfigurationPropertiesobject. Annotations are considered both on the bean itself, as well as any factory method (for example a@Beanmethod).- 参数:
applicationContext- the source application contextbean- the bean to considerbeanName- the bean name- 返回:
- a configuration properties bean or
nullif the neither the bean or factory method are annotated with@ConfigurationProperties
-