public class Html5Doc extends Object implements Html5, HtmlDoc
Usually Html5Doc is subclassed for each type of documents;
the constructor builds the document using builder methods in Html5.
For example
public class HelloHtml extends Html5Doc
{
public HelloHtml(String name)
{
_head(
_link().type("text/css").href("/site.css")
);
_body(()->
{
_p("hello, ", name);
});
}
}
See also Html4Doc.
Html5.A, Html5.ABBR, Html5.ADDRESS, Html5.AREA, Html5.ARTICLE, Html5.ASIDE, Html5.AUDIO, Html5.B, Html5.BASE, Html5.BDI, Html5.BDO, Html5.BLOCKQUOTE, Html5.BODY, Html5.BR, Html5.BUTTON, Html5.CANVAS, Html5.CAPTION, Html5.CITE, Html5.CODE, Html5.COL, Html5.COLGROUP, Html5.DATA, Html5.DATALIST, Html5.DD, Html5.DEL, Html5.DETAILS, Html5.DFN, Html5.DIALOG, Html5.DIV, Html5.DL, Html5.DT, Html5.Element<This extends T4,T4>, Html5.EM, Html5.EMBED, Html5.FIELDSET, Html5.FIGCAPTION, Html5.FIGURE, Html5.FOOTER, Html5.FORM, Html5.H1, Html5.H2, Html5.H3, Html5.H4, Html5.H5, Html5.H6, Html5.HEAD, Html5.HEADER, Html5.HR, Html5.HTML, Html5.I, Html5.IFRAME, Html5.IMG, Html5.INPUT, Html5.INS, Html5.KBD, Html5.KEYGEN, Html5.LABEL, Html5.LEGEND, Html5.LI, Html5.LINK, Html5.MAIN, Html5.MAP, Html5.MARK, Html5.MENU, Html5.MENUITEM, Html5.META, Html5.METER, Html5.NAV, Html5.NOSCRIPT, Html5.OBJECT, Html5.OL, Html5.OPTGROUP, Html5.OPTION, Html5.OUTPUT, Html5.P, Html5.PARAM, Html5.ParentElement<This extends T4,T4>, Html5.PRE, Html5.PROGRESS, Html5.Q, Html5.RP, Html5.RT, Html5.RUBY, Html5.S, Html5.SAMP, Html5.SCRIPT, Html5.SECTION, Html5.SELECT, Html5.SMALL, Html5.SOURCE, Html5.SPAN, Html5.STRONG, Html5.STYLE, Html5.SUB, Html5.SUMMARY, Html5.SUP, Html5.TABLE, Html5.TBODY, Html5.TD, Html5.TEMPLATE, Html5.TEXTAREA, Html5.TFOOT, Html5.TH, Html5.THEAD, Html5.TIME, Html5.TITLE, Html5.TR, Html5.TRACK, Html5.U, Html5.UL, Html5.VAR, Html5.VIDEO, Html5.WBRHtmlBuilder.ContextParent| Modifier and Type | Field and Description |
|---|---|
protected Html5.HTML |
html
The <html> element.
|
protected Html5.HEAD |
head
The <head> element.
|
protected Html5.BODY |
body
The <body> element.
|
| Constructor and Description |
|---|
Html5Doc()
Create an html5 document.
|
| Instance Methods | |
|---|---|
Html5.HTML |
_html()
Return the <html> element.
|
Html5.HTML |
_html(Object... children)
Deprecated.
Do not add more children to <html>
|
Html5.HTML |
_html(Runnable code)
Deprecated.
Do not add more children to <html>
|
Html5.HEAD |
_head()
Return the <head> element.
|
Html5.HEAD |
_head(Object... children)
Add children to the <head> element.
|
Html5.HEAD |
_head(Runnable code)
Run `code` with the <head> element as the context parent.
|
Html5.BODY |
_body()
Return the <body> element.
|
Html5.BODY |
_body(Object... children)
Add children to the <body> element.
|
Html5.BODY |
_body(Runnable code)
Run `code` with the <body> element as the context parent.
|
void |
getContentBody(Consumer<CharSequence> out)
Print the content body to `out`.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait_a, _a, _a, _abbr, _abbr, _abbr, _address, _address, _address, _area, _article, _article, _article, _aside, _aside, _aside, _audio, _audio, _audio, _b, _b, _b, _base, _bdi, _bdi, _bdi, _bdo, _bdo, _bdo, _blockquote, _blockquote, _blockquote, _br, _button, _button, _button, _canvas, _canvas, _canvas, _caption, _caption, _caption, _cite, _cite, _cite, _code, _code, _code, _col, _colgroup, _colgroup, _colgroup, _data, _data, _data, _datalist, _datalist, _datalist, _dd, _dd, _dd, _del, _del, _del, _details, _details, _details, _dfn, _dfn, _dfn, _dialog, _dialog, _dialog, _div, _div, _div, _dl, _dl, _dl, _dt, _dt, _dt, _em, _em, _em, _embed, _fieldset, _fieldset, _fieldset, _figcaption, _figcaption, _figcaption, _figure, _figure, _figure, _footer, _footer, _footer, _form, _form, _form, _h1, _h1, _h1, _h2, _h2, _h2, _h3, _h3, _h3, _h4, _h4, _h4, _h5, _h5, _h5, _h6, _h6, _h6, _header, _header, _header, _hr, _i, _i, _i, _iframe, _iframe, _iframe, _img, _input, _ins, _ins, _ins, _kbd, _kbd, _kbd, _keygen, _label, _label, _label, _legend, _legend, _legend, _li, _li, _li, _link, _main, _main, _main, _map, _map, _map, _mark, _mark, _mark, _menu, _menu, _menu, _menuitem, _meta, _meter, _meter, _meter, _nav, _nav, _nav, _noscript, _noscript, _noscript, _object, _object, _object, _ol, _ol, _ol, _optgroup, _optgroup, _optgroup, _option, _option, _option, _output, _output, _output, _p, _p, _p, _param, _pre, _pre, _pre, _progress, _progress, _progress, _q, _q, _q, _rp, _rp, _rp, _rt, _rt, _rt, _ruby, _ruby, _ruby, _s, _s, _s, _samp, _samp, _samp, _script, _script, _script, _section, _section, _section, _select, _select, _select, _small, _small, _small, _source, _span, _span, _span, _strong, _strong, _strong, _style, _style, _style, _sub, _sub, _sub, _summary, _summary, _summary, _sup, _sup, _sup, _table, _table, _table, _tbody, _tbody, _tbody, _td, _td, _td, _template, _template, _template, _textarea, _textarea, _textarea, _tfoot, _tfoot, _tfoot, _th, _th, _th, _thead, _thead, _thead, _time, _time, _time, _title, _title, _title, _tr, _tr, _tr, _track, _u, _u, _u, _ul, _ul, _ul, _var, _var, _var, _video, _video, _video, _wbrgetCharset, getContentType, toResponsegetContentBodyprotected final Html5.HTML html
protected final Html5.HEAD head
protected final Html5.BODY body
public Html5Doc()
This constructor builds a basic html tree of
<html>
<head></head>
<body></body>
</html>
Subclass constructor should fill in more elements to <head> and <body>.
public Html5.HTML _html()
This method overrides the super method with a different meaning. Instead of creating a new <html> element, it returns the existing <html> element created in the constructor. The <html> already contains two children <head> and <body>, do not add more children to it.
public Html5.HTML _html(Object... children)
This method overrides the super method with a different meaning. Instead of creating a new <html> element, it returns the existing <html> element created in the constructor. The <html> already contains two children <head> and <body>, do not add more children to it.
public Html5.HTML _html(Runnable code)
This method overrides the super method with a different meaning. Instead of creating a new <html> element, it returns the existing <html> element created in the constructor. The <html> already contains two children <head> and <body>, do not add more children to it.
public Html5.HEAD _head()
This method overrides the super method with a different meaning. Instead of creating a new <head> element, it returns the existing <head> element created in the constructor.
public Html5.HEAD _head(Object... children)
This method overrides the super method with a different meaning. Instead of creating a new <head> element, it returns the existing <head> element created in the constructor.
public Html5.HEAD _head(Runnable code)
This method overrides the super method with a different meaning. Instead of creating a new <head> element, it returns the existing <head> element created in the constructor.
public Html5.BODY _body()
This method overrides the super method with a different meaning. Instead of creating a new <body> element, it returns the existing <body> element created in the constructor.
public Html5.BODY _body(Object... children)
This method overrides the super method with a different meaning. Instead of creating a new <body> element, it returns the existing <body> element created in the constructor.
public Html5.BODY _body(Runnable code)
This method overrides the super method with a different meaning. Instead of creating a new <body> element, it returns the existing <body> element created in the constructor.
public void getContentBody(Consumer<CharSequence> out)
Html5.DOCTYPE will be printed first,
followed by the html tree.
getContentBody in interface TextDoc