gpt4 book ai didi

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

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

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

Xembler.xml介绍

[英]Convert to XML document.
[中]转换为XML文档。

代码示例

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

/**
 * Convert to XML document, without checked exceptions.
 * @return XML document
 * @since 0.18
 */
public String xmlQuietly() {
  try {
    return this.xml();
  } catch (final ImpossibleModificationException ex) {
    throw new IllegalStateException(
      String.format(
        "failed to build XML quietly: %s",
        this.directives
      ),
      ex
    );
  }
}

代码示例来源:origin: com.jcabi.incubator/xembly

/**
 * Convert to XML document, without checked exceptions.
 * @return XML document
 * @since 0.18
 */
public String xmlQuietly() {
  try {
    return this.xml();
  } catch (final ImpossibleModificationException ex) {
    throw new IllegalStateException(
      String.format(
        "failed to build XML quietly: %s",
        this.directives
      ),
      ex
    );
  }
}

代码示例来源: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: 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);
  }
}

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