Class XmlOutputFormat

  • All Implemented Interfaces:
    java.lang.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 keepBlankLines  
      • Fields inherited from class org.dom4j.io.OutputFormat

        STANDARD_INDENT
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlOutputFormat()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isKeepBlankLines()
      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 java.lang.Object

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

      • keepBlankLines

        private boolean keepBlankLines
    • Constructor Detail

      • XmlOutputFormat

        public XmlOutputFormat()
    • Method Detail

      • 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.