Annotation Interface Html
HtmlSerializer.
Can be used in the following locations:
- Marshalled classes/methods/fields.
@Rest -annotated classes and@RestOp -annotated methods when used with@HtmlApply.
See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionUse the specified anchor text when serializing a URI.String[]Optional description for the exposed API.Specifies what format to use for the HTML element.Adds a hyperlink to a bean property when rendered as HTML.booleanWhentrue , don't add headers to tables.booleanWhentrue , collections of beans should be rendered as trees instead of tables.Class<? extends HtmlRender>Associates anHtmlRenderwith a bean property for custom HTML rendering of the property.Specifies the CSS style to apply to the HTML element containing the bean property value.
-
Element Details
-
anchorText
Use the specified anchor text when serializing a URI.The text can contain any bean property values resolved through variables of the form
"{property-name}" .Example:
// Produces <a href='...'>drive</a> when serialized to HTML. @Html (anchorText="drive" )@URI // Treat property as a URL public String getDrive() {...}This overrides the behavior specified by
HtmlSerializer.Builder.uriAnchorText(AnchorText).- Returns:
- The annotation value.
- Default:
- ""
-
description
Optional description for the exposed API.- Returns:
- The annotation value.
- Since:
- 9.2.0
- Default:
- {}
-
format
Specifies what format to use for the HTML element.- Returns:
- The annotation value.
- Default:
- HTML
-
link
Adds a hyperlink to a bean property when rendered as HTML.The text can contain any bean property values resolved through variables of the form
"{property-name}" .The URLs can be any of the following forms:
- Absolute - e.g.
"http://host:123/myContext/myServlet/myPath" - Context-root-relative - e.g.
"/myContext/myServlet/myPath" - Context-relative - e.g.
"context:/myServlet/myPath" - Servlet-relative - e.g.
"servlet:/myPath" - Path-info-relative - e.g.
"myPath"
Example:
public class FileSpace {@Html (link="servlet:/drive/{drive}" )public String getDrive() { ...; } }- Returns:
- The annotation value.
- Default:
- ""
- Absolute - e.g.
-
noTableHeaders
boolean noTableHeaders- Returns:
- The annotation value.
- Default:
- false
-
noTables
boolean noTablesWhentrue , collections of beans should be rendered as trees instead of tables.Default is
false .- Returns:
- The annotation value.
- Default:
- false
-
render
Class<? extends HtmlRender> renderAssociates anHtmlRenderwith a bean property for custom HTML rendering of the property.This annotation applies to bean properties and classes.
- Returns:
- The annotation value.
- Default:
- org.apache.juneau.marshall.html.HtmlRender.class
-
style
Specifies the CSS style to apply to the HTML element containing the bean property value.This is a simpler alternative to using
render()when you only need to apply CSS styling without custom content transformation.Example:
// Apply styling to a bean property @Html (style="white-space:normal;min-width:200px" )public String getField() {...}If both
style()andrender()are specified, the render takes precedence.- Returns:
- The annotation value.
- Default:
- ""
-