gpt4 book ai didi

org.xembly.Xembler.applyQuietly()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 11:19:05 25 4
gpt4 key购买 nike

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

Xembler.applyQuietly介绍

[英]Apply all changes to the document/node, without any checked exceptions.
[中]将所有更改应用于文档/节点,无任何选中的异常。

代码示例

代码示例来源:origin: yegor256/takes

/**
 * Render source as XML.
 * @param dom DOM node to build upon
 * @param src Source
 * @return XML
 * @throws IOException If fails
 */
private static InputStream render(final Node dom,
  final XeSource src) throws IOException {
  final Node copy = cloneNode(dom);
  final ByteArrayOutputStream baos =
    new ByteArrayOutputStream();
  final Node node = new Xembler(src.toXembly()).applyQuietly(copy);
  try {
    TransformerFactory.newInstance().newTransformer().transform(
      new DOMSource(node),
      new StreamResult(
        new Utf8OutputStreamWriter(baos)
      )
    );
  } catch (final TransformerException ex) {
    throw new IllegalStateException(ex);
  }
  return new ByteArrayInputStream(baos.toByteArray());
}

代码示例来源:origin: org.takes/takes

/**
 * Render source as XML.
 * @param dom DOM node to build upon
 * @param src Source
 * @return XML
 * @throws IOException If fails
 */
private static InputStream render(final Node dom,
  final XeSource src) throws IOException {
  final Node copy = cloneNode(dom);
  final ByteArrayOutputStream baos =
    new ByteArrayOutputStream();
  final Node node = new Xembler(src.toXembly()).applyQuietly(copy);
  try {
    TransformerFactory.newInstance().newTransformer().transform(
      new DOMSource(node),
      new StreamResult(
        new Utf8OutputStreamWriter(baos)
      )
    );
  } catch (final TransformerException ex) {
    throw new IllegalStateException(ex);
  }
  return new ByteArrayInputStream(baos.toByteArray());
}

代码示例来源:origin: jcabi/jcabi-github

@Override
public void apply(
  final Iterable<Directive> dirs
) throws IOException {
  synchronized (this.name) {
    FileUtils.write(
      new File(this.name),
      new XMLDocument(
        new Xembler(dirs).applyQuietly(this.xml().node())
      ).toString(),
      StandardCharsets.UTF_8
    );
  }
}
@Override

代码示例来源:origin: yegor256/jpeek

.add("defects")
      .set(Double.toString(defects / total)).up()
  ).applyQuietly(xml.node())
);

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