code: private static Configuration createCfg(TemplateConfig config) {
  		if (null == config) {
  			config = new TemplateConfig();
  		}
  
  		final Configuration cfg = new Configuration(Configuration.VERSION_2_3_28);
  		cfg.setLocalizedLookup(false);
  		cfg.setDefaultEncoding(config.getCharset().toString());
  
  		switch (config.getResourceMode()) {
  		case CLASSPATH:
  			cfg.setTemplateLoader(new ClassTemplateLoader(ClassUtil.getClassLoader(), config.getPath()));
  			break;
  		case FILE:
  			try {
  				cfg.setTemplateLoader(new FileTemplateLoader(FileUtil.file(config.getPath())));
  			} catch (IOException e) {
  				throw new IORuntimeException(e);
  			}
  			break;
  		case WEB_ROOT:
  			 try {
  				 cfg.setTemplateLoader(new FileTemplateLoader(FileUtil.file(FileUtil.getWebRoot(), config.getPath())));
  			 } catch (IOException e) {
  				 throw new IORuntimeException(e);
  			 }
  			break;
  		case STRING:
  			cfg.setTemplateLoader(new SimpleStringTemplateLoader());
  			break;
  		default:
  			break;
  		}
  		
  		return cfg;
  	}
docs: 创建配置项
  
  @param config 模板配置
  @return {@link Configuration }