package com.sunxung.factoring.start.impl;

import java.util.Map;

import com.sunxung.factoring.component.util.SpringUtil;
import com.sunxung.factoring.dict.Dict;

/**
 * 字典项初始化
 */
public class DictionaryInit {

    public void run() {
        Map<String, Dict> dictMap = SpringUtil.getBeansOfType(Dict.class);
        if (dictMap == null || dictMap.values() == null) {
            return;
        }
        Dict[] dicts = dictMap.values().toArray(new Dict[] {});
        for (int i = 0, len = dicts.length; i < len; i++) {
            dicts[i].add(i);
        }
    }
}
