gpt4 book ai didi

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

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

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

Xembler.<init>介绍

[英]Public ctor.
[中]公职人员。

代码示例

代码示例来源: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/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: yegor256/s3auth

new XMLDocument(new Xembler(dirs).xml())
  ).toString().getBytes(Charsets.UTF_8);
} catch (final ImpossibleModificationException ex) {

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

new XMLDocument(new Xembler(dirs).xml())
  ).toString().getBytes(Charsets.UTF_8);
} catch (final ImpossibleModificationException ex) {

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

new Xembler(
  new Directives()
    .xpath("/metric")

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

new Xembler(new Index(this.output)).xmlQuietly()
App.xsl("badge.xsl").transform(
  new XMLDocument(
    new Xembler(
      new Directives().add("badge").set(
        index.xpath("/index/@score").get(0)
App.xsl("matrix-post.xsl").transform(
  new XMLDocument(
    new Xembler(new Matrix(this.output)).xmlQuietly()

代码示例来源:origin: com.rempl/rempl

@Override
public void save(final OutputStream output) throws IOException {
  final Directives dirs = new Directives().add("xmi");
  for (final Instance instance : this.instances) {
    dirs.add("instance").add("slots");
    for (final String slot : instance.slots()) {
      dirs.add("slot").add("key").set(slot).up()
        .add("value").set(instance.get(slot)).up().up();
    }
    dirs.up().add("name").set(instance.name()).up()
      .add("type").set(instance.type()).up().up();
  }
  try {
    IOUtils.write(
      new Xembler(dirs).xml().toString().getBytes(Charsets.UTF_8),
      output
    );
  } catch (final ImpossibleModificationException ex) {
    throw new IllegalStateException(ex);
  }
}

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

final XML xml = new StrictXML(
  new XMLDocument(
    new Xembler(
      new Directives()
        .add("skeleton")

代码示例来源:origin: etsy/arbiter

new Xembler(directives).apply(xmlDoc);
} catch (ImpossibleModificationException e) {
  throw new RuntimeException(e);

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