gpt4 book ai didi

com.googlecode.htmlcompressor.compressor.XmlCompressor.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 19:00:40 28 4
gpt4 key购买 nike

本文整理了Java中com.googlecode.htmlcompressor.compressor.XmlCompressor.<init>()方法的一些代码示例,展示了XmlCompressor.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlCompressor.<init>()方法的具体详情如下:
包路径:com.googlecode.htmlcompressor.compressor.XmlCompressor
类名称:XmlCompressor
方法名:<init>

XmlCompressor.<init>介绍

暂无

代码示例

代码示例来源:origin: org.trimou/trimou-extension-minify

public XmlCompressorMinifier() {
  super(new XmlCompressor());
}

代码示例来源:origin: org.trimou/trimou-extension-minify

public XmlCompressorMinifier(Predicate<String> matchingPredicate) {
  super(new XmlCompressor(), matchingPredicate);
}

代码示例来源:origin: com.googlecode.htmlcompressor/htmlcompressor

private Compressor createXmlCompressor() throws IllegalArgumentException, OptionException {
  XmlCompressor xmlCompressor = new XmlCompressor();
  xmlCompressor.setRemoveComments(!preserveCommentsOpt);
  xmlCompressor.setRemoveIntertagSpaces(!preserveIntertagSpacesOpt);
    
  return xmlCompressor;
}

代码示例来源:origin: com.github.hazendaz/htmlcompressor

/**
 * Creates the xml compressor.
 *
 * @return the compressor
 * @throws IllegalArgumentException
 *             the illegal argument exception
 * @throws OptionException
 *             the option exception
 */
private Compressor createXmlCompressor() throws IllegalArgumentException, OptionException {
  XmlCompressor xmlCompressor = new XmlCompressor();
  xmlCompressor.setRemoveComments(!preserveCommentsOpt);
  xmlCompressor.setRemoveIntertagSpaces(!preserveIntertagSpacesOpt);
  return xmlCompressor;
}

代码示例来源:origin: com.atlassian.maven.plugins/maven-amps-plugin

scanner.scan();
XmlCompressor compressor = new XmlCompressor();
int numberOfMinifiedFile = 0;
for (String name : scanner.getIncludedFiles())

代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin

scanner.scan();
XmlCompressor compressor = new XmlCompressor();
int numberOfMinifiedFile = 0;
for (String name : scanner.getIncludedFiles())

代码示例来源:origin: com.atlassian.maven.plugins/maven-amps-plugin

XmlCompressor compressor = new XmlCompressor();
File pluginXmlFile = new File(ctx.getProject().getBuild().getOutputDirectory(), "atlassian-plugin.xml");

代码示例来源:origin: com.googlecode.htmlcompressor/htmlcompressor

@Override
public int doEndTag() throws JspException {
  
  BodyContent bodyContent = getBodyContent();
  String content = bodyContent.getString();
  
  XmlCompressor compressor = new XmlCompressor();
  compressor.setEnabled(enabled);
  compressor.setRemoveComments(removeComments);
  compressor.setRemoveIntertagSpaces(removeIntertagSpaces);
  
  try {
    bodyContent.clear();
    bodyContent.append(compressor.compress(content));
    bodyContent.writeOut(pageContext.getOut());
  } catch (IOException e) {
    e.printStackTrace();
  } catch (Exception e) {
    e.printStackTrace();
  }
  
  return super.doEndTag();
}

代码示例来源:origin: com.github.hazendaz/htmlcompressor

@Override
public int doEndTag() throws JspException {
  BodyContent bodyContent = getBodyContent();
  String content = bodyContent.getString();
  XmlCompressor compressor = new XmlCompressor();
  compressor.setEnabled(enabled);
  compressor.setRemoveComments(removeComments);
  compressor.setRemoveIntertagSpaces(removeIntertagSpaces);
  try {
    bodyContent.clear();
    bodyContent.append(compressor.compress(content));
    bodyContent.writeOut(pageContext.getOut());
  } catch (IOException e) {
    logger.error("", e);
  }
  return super.doEndTag();
}

代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin

XmlCompressor compressor = new XmlCompressor();
File pluginXmlFile = new File(ctx.getProject().getBuild().getOutputDirectory(), "atlassian-plugin.xml");

代码示例来源:origin: com.github.hazendaz/htmlcompressor

/**
 * Test compress.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void testCompress() throws Exception {
  String source = readResource("testCompress.xml");
  String result = readResource("testCompressResult.xml");
  XmlCompressor compressor = new XmlCompressor();
  assertEquals(result, compressor.compress(source));
}

代码示例来源:origin: com.github.hazendaz/htmlcompressor

/**
 * Test remove comments.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void testRemoveComments() throws Exception {
  String source = readResource("testRemoveComments.xml");
  String result = readResource("testRemoveCommentsResult.xml");
  XmlCompressor compressor = new XmlCompressor();
  compressor.setRemoveComments(true);
  assertEquals(result, compressor.compress(source));
}

代码示例来源:origin: com.github.hazendaz/htmlcompressor

/**
 * Test remove intertag spaces.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void testRemoveIntertagSpaces() throws Exception {
  String source = readResource("testRemoveIntertagSpaces.xml");
  String result = readResource("testRemoveIntertagSpacesResult.xml");
  XmlCompressor compressor = new XmlCompressor();
  compressor.setRemoveIntertagSpaces(true);
  assertEquals(result, compressor.compress(source));
}

代码示例来源:origin: com.github.hazendaz/htmlcompressor

/**
 * Test enabled.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void testEnabled() throws Exception {
  String source = readResource("testEnabled.xml");
  String result = readResource("testEnabledResult.xml");
  XmlCompressor compressor = new XmlCompressor();
  compressor.setEnabled(false);
  assertEquals(result, compressor.compress(source));
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com