Annotation Type HtmlDocConfig


Annotation for specifying config properties defined in HtmlSerializer, HtmlParser, and HtmlDocSerializer.

Used primarily for specifying bean configuration properties on REST classes and methods.

See Also:
  • Element Details

    • rank

      int rank
      Optional rank for this config.

      Can be used to override default ordering and application of config annotations.

      Returns:
      The annotation value.
      Default:
      0
    • aside

      Aside section contents.

      Allows you to specify the contents of the aside section on the HTML page. The aside section floats on the right of the page for providing content supporting the serialized content of the page.

      Example:

      @HtmlDocConfig( aside={ "<ul>", " <li>Item 1", " <li>Item 2", " <li>Item 3", "</ul>" } )

      Notes:
      • Format: HTML
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • A value of "NONE" can be used to force no value.
      • The parent value can be included by adding the literal "INHERIT" as a value.
      • Multiple values are combined with newlines into a single string.
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • asideFloat

      Float aside section contents.

      Allows you to position the aside contents of the page around the main contents.

      By default, the aside section is floated to the right.

      Example:

      @HtmlDocConfig( aside={ "<ul>", " <li>Item 1", " <li>Item 2", " <li>Item 3", "</ul>" }, asideFloat="TOP" )

      • "RIGHT"
      • "LEFT"
      • "TOP"
      • "BOTTOM"
      • "DEFAULT" (defaults to "RIGHT")
      Notes:
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class. On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      "DEFAULT"
    • footer

      Footer section contents.

      Allows you to specify the contents of the footer section on the HTML page.

      Example:

      @HtmlDocConfig( footer={ "<b>This interface is great!</b>" } )

      Notes:
      • Format: HTML
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • A value of "NONE" can be used to force no value.
      • The parent value can be included by adding the literal "INHERIT" as a value.
      • Multiple values are combined with newlines into a single string.
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • head

      Additional head section content.

      Adds the specified HTML content to the head section of the page.

      Example:

      @HtmlDocConfig( head={ "<link rel='icon' href='$U{servlet:/htdocs/mypageicon.ico}'>" } )

      Notes:
      • Format: HTML
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • A value of "NONE" can be used to force no value.
      • The head content from the parent can be included by adding the literal "INHERIT" as a value.
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • header

      Header section contents.

      Allows you to override the contents of the header section on the HTML page. The header section normally contains the title and description at the top of the page.

      Example:

      @HtmlDocConfig( header={ "<h1>My own header</h1>" } )

      Notes:
      • Format: HTML
      • A value of "NONE" can be used to force no header.
      • The parent value can be included by adding the literal "INHERIT" as a value.
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • Multiple values are combined with newlines into a single string.
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class if not overridden.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • noResultsMessage

      No-results message.

      Allows you to specify the string message used when trying to serialize an empty array or empty list.

      Example:

      @HtmlDocConfig( noResultsMessage="<b>This interface is great!</b>" )

      Notes:
      • Format: HTML
      • A value of "NONE" can be used to represent no value to differentiate it from an empty string.
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • nowrap

      Prevent word wrap on page.

      Adds "* {white-space:nowrap}" to the CSS instructions on the page to prevent word wrapping.

      • "true"
      • "false" (default)
      Notes:
      See Also:
      Returns:
      The annotation value.
      Default:
      ""
    • script

      Javascript code.

      Adds the specified Javascript code to the HTML page.

      Example:

      @HtmlDocConfig( script={ "alert('hello!');" } )

      Notes:
      • Format: Javascript
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • A value of "NONE" can be used to force no value.
      • The parent value can be included by adding the literal "INHERIT" as a value.
      • Multiple values are combined with newlines into a single string.
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • style

      CSS style code.

      Adds the specified CSS instructions to the HTML page.

      Example:

      @HtmlDocConfig( style={ "h3 { color: red; }", "h5 { font-weight: bold; }" } )

      Notes:
      • Format: CSS
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • A value of "NONE" can be used to force no value.
      • The parent value can be included by adding the literal "INHERIT" as a value.
      • Multiple values are combined with newlines into a single string.
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • stylesheet

      Stylesheet import URLs.

      Adds a link to the specified stylesheet URL.

      Note that this stylesheet is controlled by the @Rest.stylesheet() annotation.

      Notes:
      • Format: URL
      • Supports SVL Variables (e.g. "$L{my.localized.variable}").
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • template

      HTML document template.

      Specifies the template to use for serializing the page.

      By default, the BasicHtmlDocTemplate class is used to construct the contents of the HTML page, but can be overridden with your own custom implementation class.

      Example:

      @HtmlDocConfig( template=MySpecialDocTemplate.class )

      Notes:
      • On methods, this value is inherited from the @HtmlDocConfig annotation on the servlet/resource class.
      • On servlet/resource classes, this value is inherited from the @HtmlDocConfig annotation on the parent class.
      See Also:
      Returns:
      The annotation value.
      Default:
      org.apache.juneau.html.HtmlDocTemplate.Void.class
    • widgets

      Class<? extends HtmlWidget>[] widgets
      HTML Widgets.

      Defines widgets that can be used in conjunction with string variables of the form "$W{name}"to quickly generate arbitrary replacement text.

      Widgets resolve the following variables:

      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:

      @HtmlDocConfig( widgets={ MyWidget.class } navlinks={ "$W{MyWidget}" }, aside={ "Check out this widget: $W{MyWidget}" } )

      Notes:
      • Widgets are inherited from parent to child, but can be overridden by reusing the widget name.
      • Values are appended to the existing list.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}