Annotation Interface HtmlConfig


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

    • addBeanTypes

      Add "_type" properties when needed.

      If true, then "_type" properties will be added to beans if their type cannot be inferred through reflection.

      When present, this value overrides the Serializer.Builder#addBeanTypes() setting and is provided to customize the behavior of specific serializers in a SerializerSet.

      • "true"
      • "false" (default)

      Notes:

      See Also:

      Returns:
      The annotation value.
      Default:
      ""
    • addKeyValueTableHeaders

      Add key/value headers on bean/map tables.

      When enabled, key and value column headers are added to tables.

      The following shows the difference between the two generated outputs:

      Serialized output without headers
      withoutHeaders withHeaders
      Nested table without headers (1)
      f1foo
      f2bar
      Nested table without headers (2)
      keyvalue
      f1foo
      f2bar
      • "true"
      • "false" (default)

      Notes:

      See Also:

      Returns:
      The annotation value.
      Default:
      ""
    • disableDetectLabelParameters

      Don't look for link labels in URIs.

      Disables the feature where if the URL has a label parameter (e.g. "?label=foobar"), then use that as the anchor text of the link.

      The parameter name can be changed via the HtmlSerializer.Builder.labelParameter(String) property.

      The following shows the difference between the two generated outputs.
      Note that they're both hyperlinks, but the anchor text differs:

      Serialized output with labels
      withLabels withoutLabels
      Nested table with labels (1)
      keyvalue
      f1Apache Foundation
      Nested table with labels (2)
      keyvalue
      f1http://www.apache.org?label=Apache%20Foundation
      • "true"
      • "false" (default)

      Notes:

      See Also:

      Returns:
      The annotation value.
      Default:
      ""
    • disableDetectLinksInStrings

      Don't look for URLs in Strings.

      Disables the feature where if a string looks like a URL (i.e. starts with "http://" or "https://", then treat it like a URL and make it into a hyperlink based on the rules specified by HtmlSerializer.Builder.uriAnchorText(AnchorText).

      The following shows the difference between the two generated outputs:

      Serialized output with links
      withLinks withoutLinks
      Nested table with links (1)
      keyvalue
      f1http://www.apache.org
      Nested table with links (2)
      keyvalue
      f1http://www.apache.org
      • "true"
      • "false" (default)

      Notes:

      See Also:

      Returns:
      The annotation value.
      Default:
      ""
    • labelParameter

      Link label parameter name.

      The parameter name to look for when resolving link labels.

      Notes:

      See Also:

      Returns:
      The annotation value.
      Default:
      ""
    • 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
    • uriAnchorText

      Anchor text source.

      When creating anchor tags (e.g. <a href='...' >text</a>) in HTML, this setting defines what to set the inner text to.

      • "TO_STRING" - Set to whatever is returned by Annotation.toString() on the object.
      • "PROPERTY_NAME" - Set to the bean property name.
      • "URI" - Set to the URI value.
      • "LAST_TOKEN" - Set to the last token of the URI value.
      • "URI_ANCHOR" - Set to the anchor of the URL.
      • "CONTEXT_RELATIVE" - Same as "TO_STRING" but assumes it's a context-relative path.
      • "SERVLET_RELATIVE" - Same as "TO_STRING" but assumes it's a servlet-relative path.
      • "PATH_RELATIVE" - Same as "TO_STRING" but assumes it's a path-relative path.

      Notes:

      See Also:

      Returns:
      The annotation value.
      Default:
      ""