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
- Author:
- Pascal Essiembre
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLFormatter.Builder
-
Constructor Summary
Constructors Constructor Description XMLFormatter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XMLFormatter.Builderbuilder()Gets an XML formatter builder.Stringformat(XML xml)voidformat(Reader reader, Writer writer)Stringformat(String xml)
-
-
-
Method Detail
-
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
-
-