org.springframework.boot.bind

Class YamlConfigurationFactory<T>

  • All Implemented Interfaces:
    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.
    Author:
    Luke Taylor, Dave Syer
    • Constructor Detail

      • 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.
        Parameters:
        type - the root type
    • Method Detail

      • setMessageSource

        public void setMessageSource(org.springframework.context.MessageSource messageSource)
        Specified by:
        setMessageSource in interface org.springframework.context.MessageSourceAware
        Parameters:
        messageSource - the messageSource to set
      • setPropertyAliases

        public void setPropertyAliases(Map<Class<?>,Map<String,String>> propertyAliases)
        Parameters:
        propertyAliases - the propertyAliases to set
      • setYaml

        public void setYaml(String yaml)
        Parameters:
        yaml - the yaml to set
      • setResource

        public void setResource(org.springframework.core.io.Resource resource)
        Parameters:
        resource - the resource to set
      • setValidator

        public void setValidator(org.springframework.validation.Validator validator)
        Parameters:
        validator - the validator to set
      • setExceptionIfInvalid

        public void setExceptionIfInvalid(boolean exceptionIfInvalid)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getObjectType

        public Class<?> getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean<T>
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.springframework.beans.factory.FactoryBean<T>
      • getObject

        public T getObject()
                    throws Exception
        Specified by:
        getObject in interface org.springframework.beans.factory.FactoryBean<T>
        Throws:
        Exception

Copyright © 2014 Pivotal Software, Inc.. All rights reserved.