org.dom4j.io.OutputFormat.setTrimText()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(270)

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

OutputFormat.setTrimText介绍

[英]This will set whether the text is output verbatim (false) or with whitespace stripped as per org.dom4j.Element#getTextTrim(). Default: false
[中]这将设置文本是逐字输出(false),还是按照org.dom4j.Element#getTextTrim()去除空白。默认值:false

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

/**
 * @since 1.4
 */
public Dom4JDriver(NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

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

/**
   * A static helper method to create the default compact format. This format
   * does not have any indentation or newlines after an alement and all other
   * whitespace trimmed
   * 
   * @return DOCUMENT ME!
   */
  public static OutputFormat createCompactFormat() {
    OutputFormat format = new OutputFormat();
    format.setIndent(false);
    format.setNewlines(false);
    format.setTrimText(true);

    return format;
  }
}

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

setLineSeparator(args[++i]);
} else if (args[i].equals("-trimText")) {
  setTrimText(true);
} else if (args[i].equals("-padText")) {
  setPadText(true);

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

/**
 * A static helper method to create the default pretty printing format. This
 * format consists of an indent of 2 spaces, newlines after each element and
 * all other whitespace trimmed, and XMTML is false.
 * 
 * @return DOCUMENT ME!
 */
public static OutputFormat createPrettyPrint() {
  OutputFormat format = new OutputFormat();
  format.setIndentSize(2);
  format.setNewlines(true);
  format.setTrimText(true);
  format.setPadText(true);
  return format;
}

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

OutputFormat format = OutputFormat.createPrettyPrint();
format.setNewlines(newlines);
format.setTrimText(trim);
format.setXHTML(isXHTML);
format.setExpandEmptyElements(expandEmpty);

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

currentFormat.setTrimText(false);
currentFormat.setIndent("");
FormatState state = (FormatState) formatStack.pop();
currentFormat.setNewlines(state.isNewlines());
currentFormat.setTrimText(state.isTrimText());
currentFormat.setIndent(state.getIndent());

代码示例来源:origin: org.mule.modules/mule-module-xml

/**
 * @see OutputFormat#setTrimText(boolean)
 */
public synchronized void setTrimText(boolean trimText)
{
  outputFormat.setTrimText(trimText);
}

代码示例来源:origin: x-stream/xstream

/**
 * @since 1.4
 */
public Dom4JDriver(final NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

/**
 * @since 1.4
 */
public Dom4JDriver(NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

/**
 * @since 1.4
 */
public Dom4JDriver(NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

/**
 * @since 1.4
 */
public Dom4JDriver(NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

/**
 * @since 1.4
 */
public Dom4JDriver(NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouperClient

public Dom4JDriver() {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint());
  outputFormat.setTrimText(false);
}

代码示例来源:origin: org.jvnet.hudson/xstream

public Dom4JDriver() {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint());
  outputFormat.setTrimText(false);
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * @since 1.4
 */
public Dom4JDriver(NameCoder nameCoder) {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder);
  outputFormat.setTrimText(false);
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

public Dom4JDriver() {
  this(new DocumentFactory(), OutputFormat.createPrettyPrint());
  outputFormat.setTrimText(false);
}

代码示例来源:origin: dom4j/dom4j

private void testGitHubIssue26(final Element element) throws IOException {
  final OutputFormat format = new OutputFormat("    ", true);
  format.setSuppressDeclaration(false);
  format.setTrimText(true);
  format.setPadText(true);
  format.setNewlines(true);
  new XMLWriter(new CharArrayWriter(128), format).write(element);
}

代码示例来源:origin: com.intoverflow.booster/booster-core

public static OutputFormat createPrettyPrint() {
  // OutputFormat format= OutputFormat.createPrettyPrint();
  OutputFormat format = new OutputFormat();
  format.setIndentSize(2);
  format.setIndent("\t");
  format.setNewlines(true);
  format.setTrimText(true);
  format.setPadText(true);
  format.setNewLineAfterDeclaration(false);
  return format;
}

代码示例来源:origin: com.intoverflow.base/intoverflow-util

public static OutputFormat createPrettyPrint() {
  // OutputFormat format= OutputFormat.createPrettyPrint();
  OutputFormat format = new OutputFormat();
  format.setIndentSize(2);
  format.setIndent("\t");
  format.setNewlines(true);
  format.setTrimText(true);
  format.setPadText(true);
  format.setNewLineAfterDeclaration(false);
  return format;
}

代码示例来源:origin: dom4j/dom4j

public void testGitHubIssue26_case7() throws IOException {
  final Element element = new DOMElement("foo");
  element.add(new DOMText(""));
  element.add(new DOMElement("elem"));
  final OutputFormat format = new OutputFormat("    ", true);
  format.setSuppressDeclaration(false);
  format.setTrimText(false);
  format.setPadText(true);
  format.setNewlines(true);
  new XMLWriter(new CharArrayWriter(128), format).write(element);
}

相关文章