本文整理了Java中freemarker.template.Configuration.getOutputEncoding()
方法的一些代码示例,展示了Configuration.getOutputEncoding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getOutputEncoding()
方法的具体详情如下:
包路径:freemarker.template.Configuration
类名称:Configuration
方法名:getOutputEncoding
暂无
代码示例来源:origin: webx/citrus
outputCharset = configuration.getConfiguration().getOutputEncoding();
代码示例来源:origin: webx/citrus
outputCharset = configuration.getConfiguration().getOutputEncoding();
代码示例来源:origin: suninformation/ymateplatform
private void __doWriterTargetFile(String targetFileName, String tmplFile, Map<String, Object> properties) {
Writer _outWriter = null;
try {
File _outputFile = new File(this.__catalinaBase, targetFileName);
_outWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(_outputFile), StringUtils.defaultIfEmpty(__FREEMARKER_CFG.getOutputEncoding(), __FREEMARKER_CFG.getDefaultEncoding())));
Template _template = __FREEMARKER_CFG.getTemplate(__TEMPLATE_ROOT_PATH + tmplFile);
_template.process(properties, _outWriter);
System.out.println("Output file: " + _outputFile);
} catch (Exception e) {
e.printStackTrace(System.err);
} finally {
if (_outWriter != null) {
try {
_outWriter.flush();
_outWriter.close();
} catch (IOException e) {
}
}
}
}
代码示例来源:origin: suninformation/ymateplatform
private void buildTargetFile(String targetFileName, String tmplFile, Map<String, Object> propMap) {
Writer _outWriter = null;
try {
File _outputFile = new File(TARGET_ROOT_PATH, new File(((String) propMap.get("packageName")).replace('.', '/'), targetFileName).getPath());
FileUtils.mkdirs(_outputFile.getParent(), true);
Template _template = FREEMARKER_CONF.getTemplate(TEMPLATE_ROOT_PATH + tmplFile);
_outWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(_outputFile), StringUtils.defaultIfEmpty(FREEMARKER_CONF.getOutputEncoding(), FREEMARKER_CONF.getDefaultEncoding())));
_template.process(propMap, _outWriter);
System.out.println("Output file \"" + _outputFile + "\".");
} catch (Exception e) {
e.printStackTrace(System.err);
} finally {
if (_outWriter != null) {
try {
_outWriter.flush();
_outWriter.close();
} catch (IOException e) {
}
}
}
}
代码示例来源:origin: suninformation/ymate-platform-v2
private void buildTargetFile(String targetFileName, String tmplFile, Map<String, Object> properties) {
if (!__onlyShow) {
Writer _outWriter = null;
try {
File _outputFile = new File(__config.getOutputPath(), new File(__config.getPackageName().replace('.', '/'), targetFileName).getPath());
File _path = _outputFile.getParentFile();
if (_path.exists() || _path.mkdirs()) {
_outWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(_outputFile), StringUtils.defaultIfEmpty(__freemarkerConfig.getOutputEncoding(), __freemarkerConfig.getDefaultEncoding())));
__freemarkerConfig.getTemplate(__templateRootPath + tmplFile).process(properties, _outWriter);
//
System.out.println("Output file " + _outputFile);
}
} catch (Exception e) {
_LOG.warn("", RuntimeUtils.unwrapThrow(e));
} finally {
IOUtils.closeQuietly(_outWriter);
}
}
}
代码示例来源:origin: com.alibaba.citrus/citrus-webx-all
outputCharset = configuration.getConfiguration().getOutputEncoding();
内容来源于网络,如有侵权,请联系作者删除!