code: private static org.thymeleaf.TemplateEngine createEngine(TemplateConfig config) {
  		if (null == config) {
  			config = new TemplateConfig();
  		}
  		
  		ITemplateResolver resolver = null;
  		switch (config.getResourceMode()) {
  		case CLASSPATH:
  			final ClassLoaderTemplateResolver classLoaderResolver = new ClassLoaderTemplateResolver();
  			classLoaderResolver.setCharacterEncoding(config.getCharsetStr());
  			classLoaderResolver.setTemplateMode(TemplateMode.HTML);
  			classLoaderResolver.setPrefix(StrUtil.addSuffixIfNot(config.getPath(), "/"));
  			resolver = classLoaderResolver;
  			break;
  		case FILE:
  			final FileTemplateResolver fileResolver = new FileTemplateResolver();
  			fileResolver.setCharacterEncoding(config.getCharsetStr());
  			fileResolver.setTemplateMode(TemplateMode.HTML);
  			fileResolver.setPrefix(StrUtil.addSuffixIfNot(config.getPath(), "/"));
  			resolver = fileResolver;
  			break;
  		case WEB_ROOT:
  			final FileTemplateResolver webRootResolver = new FileTemplateResolver();
  			webRootResolver.setCharacterEncoding(config.getCharsetStr());
  			webRootResolver.setTemplateMode(TemplateMode.HTML);
  			webRootResolver.setPrefix(StrUtil.addSuffixIfNot(FileUtil.getAbsolutePath(FileUtil.file(FileUtil.getWebRoot(), config.getPath())), "/"));
  			resolver = webRootResolver;
  			break;
  		case STRING:
  			resolver = new StringTemplateResolver();
  			break;
  		case COMPOSITE:
  			resolver = new DefaultTemplateResolver();
  			break;
  		default:
  			resolver = new DefaultTemplateResolver();
  			break;
  		}
  		
  		final org.thymeleaf.TemplateEngine engine = new org.thymeleaf.TemplateEngine();
  		engine.setTemplateResolver(resolver);
  		return engine;
  	}
docs: 创建引擎
  
  @param config 模板配置
  @return {@link TemplateEngine}