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

com.gfk.senbot.framework.context.SpringPropertiesExposer Maven / Gradle / Ivy

package com.gfk.senbot.framework.context;

import java.io.IOException;
import java.io.Reader;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

public class SpringPropertiesExposer extends PropertySourcesPlaceholderConfigurer {

    private static Map propertiesMap = new HashMap();
    
    public SpringPropertiesExposer() {
    	super();
    }
    
    @Override
    protected void loadProperties(Properties props) throws IOException {
    	super.loadProperties(props);    	
    	for (Object key : props.keySet()) {
    		String keyStr = key.toString();
    		String valueStr = props.getProperty(keyStr);
    		propertiesMap.put(keyStr, valueStr);
    	}
    }
    
    

    public static String getProperty(String name) {
        return propertiesMap.get(name);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy