|
|
@ -4,6 +4,8 @@ import freemarker.ext.beans.BeansWrapper;
|
|
|
|
import freemarker.ext.beans.BeansWrapperBuilder;
|
|
|
|
import freemarker.ext.beans.BeansWrapperBuilder;
|
|
|
|
import freemarker.template.Configuration;
|
|
|
|
import freemarker.template.Configuration;
|
|
|
|
import freemarker.template.TemplateHashModel;
|
|
|
|
import freemarker.template.TemplateHashModel;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* ftl util
|
|
|
|
* ftl util
|
|
|
@ -11,6 +13,7 @@ import freemarker.template.TemplateHashModel;
|
|
|
|
* @author xuxueli 2018-01-17 20:37:48
|
|
|
|
* @author xuxueli 2018-01-17 20:37:48
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class FtlUtil {
|
|
|
|
public class FtlUtil {
|
|
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(FtlUtil.class);
|
|
|
|
|
|
|
|
|
|
|
|
private static BeansWrapper wrapper = new BeansWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS).build(); //BeansWrapper.getDefaultInstance();
|
|
|
|
private static BeansWrapper wrapper = new BeansWrapperBuilder(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS).build(); //BeansWrapper.getDefaultInstance();
|
|
|
|
|
|
|
|
|
|
|
@ -20,7 +23,7 @@ public class FtlUtil {
|
|
|
|
TemplateHashModel fileStatics = (TemplateHashModel) staticModels.get(packageName);
|
|
|
|
TemplateHashModel fileStatics = (TemplateHashModel) staticModels.get(packageName);
|
|
|
|
return fileStatics;
|
|
|
|
return fileStatics;
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|