All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cedarsoft.utils.configuration.ConfigurationFactory Maven / Gradle / Ivy

The newest version!
package com.cedarsoft.utils.configuration;

import com.cedarsoft.utils.configuration.xml.XmlConfigurationManager;
import org.apache.commons.configuration.Configuration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.FactoryBean;

/**
 * 

* Date: Jul 1, 2007
* Time: 6:39:21 PM
*/ @Deprecated public class ConfigurationFactory implements FactoryBean { @NotNull private final XmlConfigurationManager configurationManager; @Nullable private final Class moduleType; public ConfigurationFactory( @NotNull XmlConfigurationManager configurationManager ) { this.configurationManager = configurationManager; moduleType = null; } public ConfigurationFactory( @NotNull XmlConfigurationManager configurationManager, @Nullable Class moduleType ) { this.configurationManager = configurationManager; this.moduleType = moduleType; } @NotNull public Object getObject() throws Exception { if ( moduleType != null ) { return configurationManager.getModuleConfiguration( moduleType ); } else { return configurationManager.getConfiguration(); } } @NotNull public Class getObjectType() { return Configuration.class; } public boolean isSingleton() { return true; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy