public static class XMLFormatter.Builder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
XMLFormatter.Builder.AttributeWrap |
Modifier and Type | Method and Description |
---|---|
XMLFormatter.Builder |
attributeIndent(String indent)
String to use for indenting attributed, when wrapped.
|
XMLFormatter.Builder |
attributeWrapping(XMLFormatter.Builder.AttributeWrap attributeWrapping)
Attribute wrapping strategy.
|
XMLFormatter.Builder |
blankLineAfterComment()
Inserts a blank line after a comment.
|
XMLFormatter.Builder |
blankLineBeforeComment()
Inserts a blank line before a comment.
|
XMLFormatter |
build()
Creates an immutable, thread-safe XML formatter instance
using this builder.
|
XMLFormatter.Builder |
closeWrappingTagOnOwnLine()
Put the closing angle bracket of tags with wrapping
attributes on its own line, aligned with opening angle bracket.
|
XMLFormatter.Builder |
elementIndent(String indent)
String to use for indenting elements.
|
XMLFormatter.Builder |
maxLineLength(int charQty)
Maximum length a line can have before wrapping is performed.
|
XMLFormatter.Builder |
minTextLength(int charQty)
Minimum length for text on any line before text can be wrapped.
|
XMLFormatter.Builder |
preserveTextIndent()
Preserves indentation found in element or comment text.
|
XMLFormatter.Builder |
selfCloseEmptyElements()
Self-close elements with no or blank values.
|
public XMLFormatter.Builder elementIndent(String indent)
indent
- string to use as indentpublic XMLFormatter.Builder attributeIndent(String indent)
indent
- string to use as indentpublic XMLFormatter.Builder attributeWrapping(XMLFormatter.Builder.AttributeWrap attributeWrapping)
XMLFormatter.Builder.AttributeWrap.ALL
.attributeWrapping
- attribute wrapping strategypublic XMLFormatter.Builder closeWrappingTagOnOwnLine()
public XMLFormatter.Builder maxLineLength(int charQty)
minTextLength(int)
and XMLFormatter.Builder.AttributeWrap.NONE
both take precedence over this value.charQty
- maximum number of characters.public XMLFormatter.Builder minTextLength(int charQty)
maxLineLength
.charQty
- minimum number of characters.public XMLFormatter.Builder blankLineBeforeComment()
public XMLFormatter.Builder blankLineAfterComment()
public XMLFormatter.Builder selfCloseEmptyElements()
public XMLFormatter.Builder preserveTextIndent()
public XMLFormatter build()
Copyright © 2008–2023 Norconex Inc.. All rights reserved.