public class HtmlDocBuilder extends Object
Basically just a convenience wrapper around the servlet or method level properties for setting properties defined
by the HtmlDocSerializer
class.
This class is instantiated through the following methods:
RestContextBuilder.getHtmlDocBuilder()
- Set values programmatically during servlet initialization.
RestResponse.getHtmlDocBuilder()
- Set values programmatically during a REST request.
Modifier and Type | Method and Description |
---|---|
HtmlDocBuilder |
aside(Object... value)
Sets the HTML aside section contents.
|
HtmlDocBuilder |
footer(Object... value)
Sets the HTML footer section contents.
|
HtmlDocBuilder |
head(Object... value)
Sets the HTML head section contents.
|
HtmlDocBuilder |
header(Object... value)
Sets the HTML header section contents.
|
HtmlDocBuilder |
nav(Object... value)
Sets the HTML nav section contents.
|
HtmlDocBuilder |
navlinks(Object... value)
Sets the links in the HTML nav section.
|
HtmlDocBuilder |
noResultsMessage(Object value)
Specifies the text to display when serializing an empty array or collection.
|
HtmlDocBuilder |
nowrap(boolean value)
Shorthand method for forcing the rendered HTML content to be no-wrap.
|
HtmlDocBuilder |
script(Object... value)
Sets the HTML script section contents.
|
HtmlDocBuilder |
style(Object... value)
Sets the HTML CSS style section contents.
|
HtmlDocBuilder |
stylesheet(Object... value)
Sets the CSS URL in the HTML CSS style section.
|
HtmlDocBuilder |
template(Class<? extends HtmlDocTemplate> value)
Specifies the template class to use for rendering the HTML page.
|
HtmlDocBuilder |
template(HtmlDocTemplate value)
Specifies the template class to use for rendering the HTML page.
|
public HtmlDocBuilder header(Object... value)
The page header normally contains the title and description, but this value can be used to override the contents to be whatever you want.
navlinks(Object...)
value will be ignored.
@HtmlDoc.header()
annotation.
value
- The HTML header section contents.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder navlinks(Object... value)
The page links are positioned immediately under the title and text.
@HtmlDoc.navlinks()
annotation.
value
- The HTML nav section links links.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder nav(Object... value)
The nav section of the page contains the links.
navlinks(Object[])
value will be ignored.
@HtmlDoc.nav()
annotation.
value
- The HTML nav section contents.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder aside(Object... value)
The aside section typically floats on the right side of the page.
@HtmlDoc.aside()
annotation.
value
- The HTML aside section contents.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to waste
string concatenation cycles on non-HTML views.
public HtmlDocBuilder footer(Object... value)
The footer section typically floats on the bottom of the page.
@HtmlDoc.footer()
annotation.
value
- The HTML footer section contents.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder style(Object... value)
@HtmlDoc.style()
annotation.
value
- The HTML CSS style section contents.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder stylesheet(Object... value)
Specifies the URL to the stylesheet to add as a link in the style tag in the header.
@HtmlDoc.stylesheet()
annotation.
value
- The CSS URL in the HTML CSS style section.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder script(Object... value)
@HtmlDoc.script()
annotation.
value
- The HTML script section contents.
Object will be converted to a string using Object.toString()
.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder head(Object... value)
@HtmlDoc.head()
annotation.
value
- The HTML head section contents.
StringMessage
to generate value with delayed serialization so as not to
waste string concatenation cycles on non-HTML views.
public HtmlDocBuilder nowrap(boolean value)
@HtmlDoc.nowrap()
annotation.
value
- The new nowrap setting.public HtmlDocBuilder noResultsMessage(Object value)
@HtmlDoc.noResultsMessage()
annotation.
value
- The text to display when serializing an empty array or collection.public HtmlDocBuilder template(Class<? extends HtmlDocTemplate> value)
By default, uses HtmlDocTemplateBasic
to render the contents, although you can provide your own custom
renderer or subclasses from the basic class to have full control over how the page is rendered.
@HtmlDoc.template()
annotation.
value
- The HTML page template to use to render the HTML page.public HtmlDocBuilder template(HtmlDocTemplate value)
By default, uses HtmlDocTemplateBasic
to render the contents, although you can provide your own custom
renderer or subclasses from the basic class to have full control over how the page is rendered.
@HtmlDoc.template()
annotation.
value
- The HTML page template to use to render the HTML page.Copyright © 2018 Apache. All rights reserved.