Class FallbackPropertyFactory<T>

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.craftercms.engine.util.spring.properties.FallbackPropertyFactory<T>
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<T>, org.springframework.beans.factory.InitializingBean

public class FallbackPropertyFactory<T> extends org.springframework.beans.factory.config.AbstractFactoryBean<T>
String FactoryBean implementation to provide a convenience way to fallback in a list of properties until one of them is not empty/null.
  • Field Summary

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE
  • Constructor Summary

    Constructors
    Constructor
    Description
    FallbackPropertyFactory(List<String> properties, Class<T> type)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected T
     
     
    void
    setDefaultValue(T defaultValue)
     

    Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FallbackPropertyFactory

      public FallbackPropertyFactory(List<String> properties, Class<T> type)
  • Method Details

    • setDefaultValue

      public void setDefaultValue(T defaultValue)
    • getObjectType

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

      protected T createInstance() throws Exception
      Specified by:
      createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<T>
      Throws:
      Exception