Top Description Fields Constructors Methods
org.assertj.core.util.xml

public Class XmlStringPrettyFormatter

extends Object
Class Inheritance
Static Imports
org.assertj.core.util.Preconditions.checkArgument

Format an XML String with indent = 2 space.

Very much inspired by http://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java and http://pastebin.com/XL7932aC

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
prettyFormat(org.w3c.dom.Document document, boolean keepXmlDeclaration)

private static org.w3c.dom.Document
toXmlDocument(String xmlString)

public static String
xmlPrettyFormat(String xmlStringToFormat)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FORMAT_ERRORback to summary
private static final String FORMAT_ERROR

Constructor Detail

XmlStringPrettyFormatterback to summary
private XmlStringPrettyFormatter()

Method Detail

prettyFormatback to summary
private static String prettyFormat(org.w3c.dom.Document document, boolean keepXmlDeclaration)
toXmlDocumentback to summary
private static org.w3c.dom.Document toXmlDocument(String xmlString)
xmlPrettyFormatback to summary
public static String xmlPrettyFormat(String xmlStringToFormat)