public final class HtmlNewLine extends Object implements HtmlPiece
See the render(indent, out)
method in this class
for how it's actually rendered.
The rendering algorithm will not automatically introduce spaces between two inline elements. You can manually insert an HtmlNewLine between two inline elements for formatting purpose (if it's ok to insert spaces between them).
See also HtmlBuilder._newline()
.
Modifier and Type | Field and Description |
---|---|
static HtmlNewLine |
instance
An instance of HtmlNewLine.
|
Constructor and Description |
---|
HtmlNewLine()
Create an HtmlNewLine instance.
|
public static final HtmlNewLine instance
public HtmlNewLine()
Note that HtmlNewLine is stateless. You can use
HtmlNewLine.instance
instead.
public void render(int indent, Consumer<CharSequence> out)
More accurately, render an indentation string
HtmlPiece.indent(indent)
to `out`.
Note that if `indent<0`, nothing will be rendered.
If necessary, use HtmlRaw
("\n") instead.