//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.tohi.common.pwdutil;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Map.Entry;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.util.PropertyPlaceholderHelper;

public class PropertiesConfigurerUtil extends PropertyPlaceholderConfigurer {
    private static Map<String, String> properties = new HashMap();

    public PropertiesConfigurerUtil() {
    }

    protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException {
        PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper("${", "}", ":", false);
        Iterator var5 = props.entrySet().iterator();

        while(var5.hasNext()) {
            Entry<Object, Object> entry = (Entry)var5.next();
            String stringKey = String.valueOf(entry.getKey()).trim();
            String stringValue = String.valueOf(entry.getValue()).trim();
            stringValue = helper.replacePlaceholders(stringValue, props);
            properties.put(stringKey, stringValue);
        }

        super.processProperties(beanFactoryToProcess, props);
    }

    public static Map<String, String> getProperties() {
        return properties;
    }

    public static String getProperty(String proName) {
        return (String)properties.get(proName);
    }
}
