类 YamlConfigurationFactory<T>
- java.lang.Object
- org.springframework.boot.bind.YamlConfigurationFactory<T>
- 类型参数:
T
- the configuration type
- 所有已实现的接口:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.FactoryBean<T>
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.MessageSourceAware
public class YamlConfigurationFactory<T> extends Object implements org.springframework.beans.factory.FactoryBean<T>, org.springframework.context.MessageSourceAware, org.springframework.beans.factory.InitializingBean
Validate some YAML by binding it to an object of a specified type and then optionally running aValidator
over it.
构造器概要
构造器 构造器 说明 YamlConfigurationFactory(Class<?> type)
Sets a validation constructor which will be applied to the YAML doc to see whether it matches the expected JavaBean.
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
T
getObject()
Class<?>
getObjectType()
boolean
isSingleton()
void
setExceptionIfInvalid(boolean exceptionIfInvalid)
已过时。as of 1.5, do not specify aValidator
if validation should not occurvoid
setMessageSource(org.springframework.context.MessageSource messageSource)
Set the message source.void
setPropertyAliases(Map<Class<?>,Map<String,String>> propertyAliases)
Set the property aliases.void
setResource(org.springframework.core.io.Resource resource)
Set the resource.void
setValidator(org.springframework.validation.Validator validator)
Set the validator.void
setYaml(String yaml)
Set the YAML.
构造器详细资料
YamlConfigurationFactory
public YamlConfigurationFactory(Class<?> type)
Sets a validation constructor which will be applied to the YAML doc to see whether it matches the expected JavaBean.- 参数:
type
- the root type
方法详细资料
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
Set the message source.- 指定者:
setMessageSource
在接口中org.springframework.context.MessageSourceAware
- 参数:
messageSource
- the message source
setPropertyAliases
public void setPropertyAliases(Map<Class<?>,Map<String,String>> propertyAliases)
Set the property aliases.- 参数:
propertyAliases
- the property aliases
setResource
public void setResource(org.springframework.core.io.Resource resource)
Set the resource.- 参数:
resource
- the resource
setValidator
public void setValidator(org.springframework.validation.Validator validator)
Set the validator.- 参数:
validator
- the validator
setExceptionIfInvalid
@Deprecated public void setExceptionIfInvalid(boolean exceptionIfInvalid)
已过时。as of 1.5, do not specify aValidator
if validation should not occurSet a flag to indicate that an exception should be raised if a Validator is available and validation fails.- 参数:
exceptionIfInvalid
- the flag to set
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 抛出:
Exception
getObjectType
public Class<?> getObjectType()
- 指定者:
getObjectType
在接口中org.springframework.beans.factory.FactoryBean<T>
isSingleton
public boolean isSingleton()
- 指定者:
isSingleton
在接口中org.springframework.beans.factory.FactoryBean<T>