HtmlDocConfig
@Deprecated public @interface HtmlDoc
HtmlDocSerializer
.
Used with @RestResource(htmldoc)
and @RestMethod(htmldoc)
to customize the HTML view of serialized POJOs.
All annotations specified here have no effect on any serializers other than HtmlDocSerializer
and is
provided as a shorthand method of for specifying configuration properties.
For example, the following two methods for defining the HTML nav links are considered equivalent:
The purpose of these annotation is to populate the HTML document view which by default consists of the following structure:
Modifier and Type | Optional Element and Description |
---|---|
String[] |
aside
Deprecated.
Sets the HTML aside section contents.
|
String[] |
footer
Deprecated.
Sets the HTML footer section contents.
|
String[] |
head
Deprecated.
Adds arbitrary content to the HTML
|
String[] |
header
Deprecated.
Sets the HTML header section contents.
|
String[] |
nav
Deprecated.
Sets the HTML nav section contents.
|
String[] |
navlinks
Deprecated.
Sets the links in the HTML nav section.
|
String |
noResultsMessage
Deprecated.
Specifies the text to display when serializing an empty array or collection.
|
String |
nowrap
Deprecated.
Shorthand method for forcing the rendered HTML content to be no-wrap.
|
String[] |
script
Deprecated.
Sets the HTML script section contents.
|
String[] |
style
Deprecated.
Sets the HTML CSS style section contents.
|
String[] |
stylesheet
Deprecated.
Sets the CSS URL in the HTML CSS style section.
|
Class<? extends HtmlDocTemplate> |
template
Deprecated.
Specifies the template class to use for rendering the HTML page.
|
Class<? extends Widget>[] |
widgets
Deprecated.
Configuration property: HTML Widgets.
|
public abstract String[] aside
The aside section typically floats on the right side of the page.
public abstract String[] footer
The footer section typically floats on the bottom of the page.
public abstract String[] head
public abstract String[] header
The page header normally contains the title and description, but this value can be used to override the contents to be whatever you want.
public abstract String[] nav
The nav section of the page contains the links.
navlinks()
is also specified, this content is placed AFTER the navigation links.
public abstract String[] navlinks
The page links are positioned immediately under the title and text.
The value is an array of strings with two possible values:
public abstract String noResultsMessage
public abstract String[] script
public abstract String[] style
public abstract String[] stylesheet
Specifies the URL to the stylesheet to add as a link in the style tag in the header.
public abstract Class<? extends HtmlDocTemplate> template
By default, uses BasicHtmlDocTemplate
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.
public abstract Class<? extends Widget>[] widgets
Defines widgets that can be used in conjunction with string variables of the form
Widgets resolve the following variables:
Widget.getHtml(RestRequest,RestResponse)
.
Widget.getScript(RestRequest,RestResponse)
.
Widget.getStyle(RestRequest,RestResponse)
.
The following examples shows how to associate a widget with a REST method and then have it rendered in the links and aside section of the page:
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.