public class HtmlPage extends Element
origElementDEFAULT_INTENDATION, HTML_DOCTYPE, name, REQUIRED_MSG, XML_HEADERA, A_ACTION, A_CELLPADDING, A_CELLSPACING, A_CLASS, A_COLS, A_COLSPAN, A_CONTENT, A_FOR, A_HREF, A_CHARSET, A_CHECKED, A_ID, A_LANG, A_LANGUAGE, A_MAXLENGTH, A_MEDIA, A_METHOD, A_NAME, A_READONLY, A_REL, A_ROWS, A_ROWSPAN, A_SELECTED, A_SRC, A_TARGET, A_TYPE, A_VALUE, BODY, BR, BUTTON, DIV, FIELDSET, FORM, H1, H2, H3, HEAD, HEADING_PREFIX, HTML, INPUT, LABEL, LEGEND, LI, LINK, META, OL, OPTION, P, PRE, SCRIPT, SELECT, SPAN, STYLE, TABLE, TD, TEXT_AREA, TH, THEAD, TITLE, TR, UL, V_BLANK, V_GET, V_HIDDEN, V_CHECKBOX, V_PASSWORD, V_POST, V_RESET, V_STYLESHEET, V_SUBMIT, V_TEXT, V_TEXT_CSS| Constructor and Description |
|---|
HtmlPage(HtmlConfig config,
Writer writer)
Create new instance with empty html headers
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Element> |
addCssBody(CharSequence css)
Create a new CSS element and return it
|
<T extends Element> |
addCssLink(CharSequence css)
Create a new CSS element and return it
|
void |
addCssLinks(CharSequence... css)
Create a new CSS element and return it
|
<T extends Element> |
addJavascriptContents(CharSequence javascript)
Create a new Javascript element and return it
|
<T extends Element> |
addJavascriptLink(boolean defer,
CharSequence javascriptLink)
Create a new Javascript element and return it
|
void |
addJavascriptLinks(boolean defer,
CharSequence... javascriptLinks)
Create a new Javascript element and return it
|
void |
close() |
<T extends Element> |
getBody()
Returns a body element
|
HtmlConfig |
getConfig()
Get config
|
<T extends Element> |
getHead()
Returns a head element
|
CharSequence |
getTitle()
Get title of configuration
|
static HtmlPage |
niceOf(javax.servlet.http.HttpServletResponse response,
CharSequence... cssLinks)
Create new instance with empty html headers
|
static HtmlPage |
niceOf(CharSequence title,
javax.servlet.http.HttpServletResponse response,
CharSequence... cssLinks)
Create new instance with empty html headers
|
static HtmlPage |
niceOf(CharSequence title,
javax.servlet.http.HttpServletResponse response,
Charset charset,
CharSequence... cssLinks)
Create new instance with empty html headers
|
static HtmlPage |
of(HtmlConfig config)
Create new instance with empty html headers for
|
static HtmlPage |
of(javax.servlet.http.HttpServletResponse response,
HtmlConfig config)
Create new instance with empty html headers
|
static HtmlPage |
of(javax.servlet.http.HttpServletResponse response,
CharSequence... cssLinks)
Create new instance with empty html headers
|
static HtmlPage |
of(CharSequence title,
javax.servlet.http.HttpServletResponse response,
CharSequence... cssLinks)
Create new instance with empty html headers
|
static HtmlPage |
of(CharSequence title,
javax.servlet.http.HttpServletResponse response,
Charset charset,
CharSequence... cssLinks)
Create new instance with empty html headers
|
String |
toString()
Returns an Render the HTML code including header.
|
addAnchor, addAnchoredText, addBody, addBreak, addButton, addCDATA, addComment, addDiv, addElement, addElement, addFieldset, addForm, addHeading, addHeading, addInput, addLabel, addLink, addListItem, addOption, addOrderedList, addParagraph, addPasswordInput, addPreformatted, addRawText, addScript, addSelect, addSelectOptions, addSpan, addStyle, addSubmitButton, addTable, addTable, addTable, addTableDetail, addTableHead, addTableRow, addText, addText, addTextArea, addTextInput, addTextSeparted, addTitle, addUnorderedlist, createHtmlRoot, createHtmlRoot, setAction, setAttrib, setCellPadding, setCellSpacing, setClass, setCols, setColSpan, setFor, setHref, setId, setMethod, setName, setRows, setRowSpan, setType, setValuegetNamepublic HtmlPage(@Nonnull HtmlConfig config, @Nonnull Writer writer)
public <T extends Element> T getHead()
public void addJavascriptLinks(boolean defer,
@Nonnull
CharSequence... javascriptLinks)
javascriptLinks - URL list to Javascriptdefer - A script that will not run until after the page has loadedpublic <T extends Element> T addJavascriptLink(boolean defer, @Nonnull CharSequence javascriptLink)
javascriptLink - URL to Javascriptdefer - A script that will not run until after the page has loadedpublic <T extends Element> T addJavascriptContents(@Nonnull CharSequence javascript)
javascript - Add a javascriptLink linkpublic void addCssLinks(@Nonnull CharSequence... css)
css - Add a CSS linkpublic <T extends Element> T addCssLink(@Nonnull CharSequence css)
css - Add a CSS linkpublic <T extends Element> T addCssBody(@Nonnull CharSequence css)
css - CSS content@Nonnull public String toString() throws IllegalStateException
toString in class ElementIllegalStateExceptionpublic void close()
throws IllegalStateException
close in interface Closeableclose in interface AutoCloseableclose in class ElementIllegalStateException@Nonnull public HtmlConfig getConfig()
public CharSequence getTitle()
@Nonnull public static HtmlPage of(@Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull CharSequence... cssLinks)
IllegalStateException - IO exceptions@Nonnull public static HtmlPage of(@Nonnull CharSequence title, @Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull CharSequence... cssLinks)
IllegalStateException - IO exceptions@Nonnull public static HtmlPage of(@Nonnull CharSequence title, @Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull Charset charset, @Nonnull CharSequence... cssLinks)
IllegalStateException - IO exceptions@Nonnull public static HtmlPage niceOf(@Nonnull CharSequence title, @Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull CharSequence... cssLinks)
IllegalStateException - IO exceptions@Nonnull public static HtmlPage niceOf(@Nonnull CharSequence title, @Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull Charset charset, @Nonnull CharSequence... cssLinks)
IllegalStateException - IO exceptions@Nonnull public static HtmlPage niceOf(@Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull CharSequence... cssLinks)
IllegalStateException - IO exceptions@Nonnull public static HtmlPage of(@Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull HtmlConfig config) throws IllegalStateException
response - HttpREsponseconfig - Html configurationIllegalStateException - IO exceptions@Nonnull public static HtmlPage of(@Nullable HtmlConfig config) throws IllegalStateException
config - Html configurationIllegalStateException - IO exceptionsCopyright 2015, Pavel Ponec