public class HtmlText extends Object implements HtmlPiece
For example,
`new HtmlText("n>", 1)`
will be rendered as
"n>1"
.
Escaping: The following chars will be escaped:
Note that double/single quotes are not escaped.
Constructor and Description |
---|
HtmlText(Object... content)
Create an HtmlText piece.
|
Instance Methods | |
---|---|
List<CharSequence> |
getContent()
Get the content of this piece.
|
void |
render(int indent,
Consumer<CharSequence> out)
Write the content to `out`, escaping special chars.
|
public HtmlText(Object... content)
See getContent()
.
If an `obj` in `content` is not a CharSequence, it will be converted to one by `String.valueOf(obj)`. `obj` can be `null`.
public List<CharSequence> getContent()
The returned char sequences are from `content` passed to the constructor.
No escaping is done by this method. If you want an escaped result, use `render(0)`.
public void render(int indent, Consumer<CharSequence> out)