Package com.norconex.commons.lang.xml

# Class XmlFormatter

java.lang.Object
com.norconex.commons.lang.xml.XmlFormatter

public class XmlFormatter extends Object
Simple XML Formatter. This formatter may not fully respect all XML specifications and may impact how the original XML would normally be parsed. If this is important to you to preserve everything (white spaces, CDATA, etc), you should use a different formatter. It is not optimized for memory (affected by very large tag content only). It is intended for formatting simple XML for human consumption. It supports XML with no root or the formatting of attributes only.

Since:
  2.0.0

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `XmlFormatter.Builder`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XmlFormatter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static XmlFormatter.Builder`
  `builder()`
  Gets an XML formatter builder.
  `String`
  `format(Xml xml)`
  `void`
  `format(Reader reader, Writer writer)`
  `String`
  `format(String xml)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### XmlFormatter

    public XmlFormatter()

- ## Method Details

  - ### format

    public String format(Xml xml)

  - ### format

    public String format(String xml)

  - ### format

    public void format(Reader reader, Writer writer) throws IOException
    Throws:
      `IOException`

  - ### builder

    public static XmlFormatter.Builder builder()
    Gets an XML formatter builder.
    Returns:
      builder