public class Html4Doc extends Object implements Html4, HtmlDoc
Usually Html4Doc is subclassed for each type of documents;
the constructor builds the document using builder methods in Html4
.
For example
public class HelloHtml extends Html4Doc { public HelloHtml(String name) { _head( _link().type("text/css").href("/site.css") ); _body(()-> { _p("hello, ", name); }); } }
See also Html5Doc
.
Html4.A, Html4.ABBR, Html4.ACRONYM, Html4.ADDRESS, Html4.AREA, Html4.B, Html4.BASE, Html4.BDO, Html4.BIG, Html4.BLOCKQUOTE, Html4.BODY, Html4.BR, Html4.BUTTON, Html4.CAPTION, Html4.CITE, Html4.CODE, Html4.COL, Html4.COLGROUP, Html4.DD, Html4.DEL, Html4.DFN, Html4.DIV, Html4.DL, Html4.DT, Html4.Element<This>, Html4.EM, Html4.FIELDSET, Html4.FORM, Html4.H1, Html4.H2, Html4.H3, Html4.H4, Html4.H5, Html4.H6, Html4.HEAD, Html4.HR, Html4.HTML, Html4.I, Html4.IFRAME, Html4.IMG, Html4.INPUT, Html4.INS, Html4.KBD, Html4.LABEL, Html4.LEGEND, Html4.LI, Html4.LINK, Html4.MAP, Html4.META, Html4.NOSCRIPT, Html4.OBJECT, Html4.OL, Html4.OPTGROUP, Html4.OPTION, Html4.P, Html4.PARAM, Html4.ParentElement<This>, Html4.PRE, Html4.Q, Html4.SAMP, Html4.SCRIPT, Html4.SELECT, Html4.SMALL, Html4.SPAN, Html4.STRONG, Html4.STYLE, Html4.SUB, Html4.SUP, Html4.TABLE, Html4.TBODY, Html4.TD, Html4.TEXTAREA, Html4.TFOOT, Html4.TH, Html4.THEAD, Html4.TITLE, Html4.TR, Html4.TT, Html4.UL, Html4.VAR
HtmlBuilder.ContextParent
Modifier and Type | Field and Description |
---|---|
protected Html4.HTML |
html
The <html> element.
|
protected Html4.HEAD |
head
The <head> element.
|
protected Html4.BODY |
body
The <body> element.
|
Constructor and Description |
---|
Html4Doc()
Create an html4 document.
|
Instance Methods | |
---|---|
Html4.HTML |
_html()
Return the <html> element.
|
Html4.HTML |
_html(Object... children)
Deprecated.
Do not add more children to <html>
|
Html4.HTML |
_html(Runnable code)
Deprecated.
Do not add more children to <html>
|
Html4.HEAD |
_head()
Return the <head> element.
|
Html4.HEAD |
_head(Object... children)
Add children to the <head> element.
|
Html4.HEAD |
_head(Runnable code)
Run `code` with the <head> element as the context parent.
|
Html4.BODY |
_body()
Return the <body> element.
|
Html4.BODY |
_body(Object... children)
Add children to the <body> element.
|
Html4.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, _acronym, _acronym, _acronym, _address, _address, _address, _area, _b, _b, _b, _base, _bdo, _bdo, _bdo, _big, _big, _big, _blockquote, _blockquote, _blockquote, _br, _button, _button, _button, _caption, _caption, _caption, _cite, _cite, _cite, _code, _code, _code, _col, _colgroup, _colgroup, _colgroup, _dd, _dd, _dd, _del, _del, _del, _dfn, _dfn, _dfn, _div, _div, _div, _dl, _dl, _dl, _dt, _dt, _dt, _em, _em, _em, _fieldset, _fieldset, _fieldset, _form, _form, _form, _h1, _h1, _h1, _h2, _h2, _h2, _h3, _h3, _h3, _h4, _h4, _h4, _h5, _h5, _h5, _h6, _h6, _h6, _hr, _i, _i, _i, _iframe, _iframe, _iframe, _img, _input, _ins, _ins, _ins, _kbd, _kbd, _kbd, _label, _label, _label, _legend, _legend, _legend, _li, _li, _li, _link, _map, _map, _map, _meta, _noscript, _noscript, _noscript, _object, _object, _object, _ol, _ol, _ol, _optgroup, _optgroup, _optgroup, _option, _option, _option, _p, _p, _p, _param, _pre, _pre, _pre, _q, _q, _q, _samp, _samp, _samp, _script, _script, _script, _select, _select, _select, _small, _small, _small, _span, _span, _span, _strong, _strong, _strong, _style, _style, _style, _sub, _sub, _sub, _sup, _sup, _sup, _table, _table, _table, _tbody, _tbody, _tbody, _td, _td, _td, _textarea, _textarea, _textarea, _tfoot, _tfoot, _tfoot, _th, _th, _th, _thead, _thead, _thead, _title, _title, _title, _tr, _tr, _tr, _tt, _tt, _tt, _ul, _ul, _ul, _var, _var, _var
getCharset, getContentType, toResponse
getContentBody
protected final Html4.HTML html
protected final Html4.HEAD head
protected final Html4.BODY body
public Html4Doc()
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 Html4.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 Html4.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 Html4.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 Html4.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 Html4.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 Html4.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 Html4.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 Html4.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 Html4.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)
Html4.DOCTYPE
will be printed first,
followed by the html tree.
getContentBody
in interface TextDoc