Class XmlOutputFormat

java.lang.Object
org.dom4j.io.OutputFormat
au.com.acegi.xmlformat.XmlOutputFormat
All Implemented Interfaces:
Cloneable

public class XmlOutputFormat extends org.dom4j.io.OutputFormat
Extended DOM4J configuration.
  • Defaults to pretty print.
  • Adds an option to keep blank lines.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     

    Fields inherited from class org.dom4j.io.OutputFormat

    STANDARD_INDENT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    When set to true, preserves at most one blank line between tags, if it was alredy present in the input file.
    void
    setKeepBlankLines(boolean keepBlankLines)
    When set to true, preserves at most one blank line between tags, if it was alredy present in the input file.

    Methods inherited from class org.dom4j.io.OutputFormat

    createCompactFormat, createPrettyPrint, getAttributeQuoteCharacter, getEncoding, getIndent, getLineSeparator, getNewLineAfterNTags, isExpandEmptyElements, isNewLineAfterDeclaration, isNewlines, isOmitEncoding, isPadText, isSuppressDeclaration, isTrimText, isXHTML, parseOptions, setAttributeQuoteCharacter, setEncoding, setExpandEmptyElements, setIndent, setIndent, setIndentSize, setLineSeparator, setNewLineAfterDeclaration, setNewLineAfterNTags, setNewlines, setOmitEncoding, setPadText, setSuppressDeclaration, setTrimText, setXHTML

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • keepBlankLines

      private boolean keepBlankLines
  • Constructor Details

    • XmlOutputFormat

      public XmlOutputFormat()
  • Method Details

    • isKeepBlankLines

      public boolean isKeepBlankLines()
      When set to true, preserves at most one blank line between tags, if it was alredy present in the input file. Defaults to false.
      Returns:
      Whether blank lines are preserved, or not.
    • setKeepBlankLines

      public void setKeepBlankLines(boolean keepBlankLines)
      When set to true, preserves at most one blank line between tags, if it was alredy present in the input file.
      Parameters:
      keepBlankLines - true to preserve at most one blank line, false to remove all blank lines.