public class HtmlElement extends Object
This is open source software released under the Apache 2.0 License
| Modifier and Type | Field and Description |
|---|---|
private boolean |
attrs |
private boolean |
mixedContent |
private String |
name |
private static Set<String> |
newLineSet |
private static Set<String> |
noIndentSet |
private HtmlCode |
writer |
| Constructor and Description |
|---|
HtmlElement(String name,
HtmlCode writer)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
(package private) HtmlElement |
close()
Closes this element after all attributes and content has been written
|
HtmlElement |
newAttribute(String name,
String value)
Writes a new attribute key and value for the current element
|
HtmlElement |
newElement(String name,
Consumer<HtmlElement> consumer)
Writes a new child element content in this element
|
HtmlElement |
text(String text)
Writes text content to the body of this element
|
private String name
private boolean attrs
private HtmlCode writer
private boolean mixedContent
public HtmlElement text(String text)
text - the text content to writepublic HtmlElement newAttribute(String name, String value)
name - the attribute namevalue - the attribute valuepublic HtmlElement newElement(String name, Consumer<HtmlElement> consumer)
name - the child element nameconsumer - the consumer to populate the child elementHtmlElement close()
Copyright 2014-2017, Xavier Witdouck