本文整理汇总了Java中com.googlecode.htmlcompressor.compressor.HtmlCompressor.setRemoveIntertagSpaces方法的典型用法代码示例。如果您正苦于以下问题:Java HtmlCompressor.setRemoveIntertagSpaces方法的具体用法?Java HtmlCompressor.setRemoveIntertagSpaces怎么用?Java HtmlCompressor.setRemoveIntertagSpaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.htmlcompressor.compressor.HtmlCompressor
的用法示例。
在下文中一共展示了HtmlCompressor.setRemoveIntertagSpaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.googlecode.htmlcompressor.compressor.HtmlCompressor; //导入方法依赖的package包/类
public String process(String src) {
HtmlCompressor compressor = new HtmlCompressor();
compressor.setEnabled(true);
compressor.setCompressCss(false);
compressor.setCompressJavaScript(false);
compressor.setGenerateStatistics(false);
compressor.setRemoveComments(options.isRemoveComments());
compressor.setRemoveMultiSpaces(options.isRemoveMutliSpaces());
compressor.setRemoveIntertagSpaces(options.isRemoveIntertagSpaces());
compressor.setRemoveQuotes(options.isRemoveQuotes());
compressor.setSimpleDoctype(options.isSimpleDoctype());
compressor.setRemoveScriptAttributes(options.isRemoveScriptAttributes());
compressor.setRemoveStyleAttributes(options.isRemoveStyleAttributes());
compressor.setRemoveLinkAttributes(options.isRemoveLinkAttributes());
compressor.setRemoveFormAttributes(options.isRemoveFormAttributes());
compressor.setRemoveInputAttributes(options.isRemoveInputAttributes());
compressor.setSimpleBooleanAttributes(options.isSimpleBooleanAttributes());
compressor.setRemoveJavaScriptProtocol(options.isRemoveJavaScriptProtocol());
compressor.setRemoveHttpProtocol(options.isRemoveHttpProtocol());
compressor.setRemoveHttpsProtocol(options.isRemoveHttpsProtocol());
compressor.setPreserveLineBreaks(options.isPreserveLineBreaks());
return compressor.compress(src);
}
示例2: save
import com.googlecode.htmlcompressor.compressor.HtmlCompressor; //导入方法依赖的package包/类
public void save() throws IOException {
String content = core.toString();
if (JRenderConfig.Server.View.useMinified) {
HtmlCompressor html = new HtmlCompressor();
html.setRemoveIntertagSpaces(true);
content = html.compress(content);
}
FileUtils.createFile(content, jrenderPath + "/core.js");
}