类 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 a Validator over it.
    • 构造器详细资料

      • 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
      • setYaml

        public void setYaml​(String yaml)
        Set the YAML.
        参数:
        yaml - the YAML
      • 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 a Validator if validation should not occur
        Set a flag to indicate that an exception should be raised if a Validator is available and validation fails.
        参数:
        exceptionIfInvalid - the flag to set
      • getObjectType

        public Class<?> getObjectType()
        指定者:
        getObjectType 在接口中 org.springframework.beans.factory.FactoryBean<T>
      • isSingleton

        public boolean isSingleton()
        指定者:
        isSingleton 在接口中 org.springframework.beans.factory.FactoryBean<T>
      • getObject

        public T getObject()
                    throws Exception
        指定者:
        getObject 在接口中 org.springframework.beans.factory.FactoryBean<T>
        抛出:
        Exception