Class Ol


@Marshalled(typeName="ol") public class Ol extends HtmlElementContainer<Ol>
DTO for an HTML <ol> element.

The ol element represents an ordered list of items. It contains li elements that represent individual list items. The list items are typically numbered automatically by the browser, and the numbering can be customized using the type and start attributes.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple ordered list Ol ol1 = ol( li("First item"), li("Second item"), li("Third item") ); // Ordered list with custom numbering Ol ol2 = ol( li("Item A"), li("Item B"), li("Item C") ).type("A").start(1); // Reversed ordered list Ol ol3 = ol( li("Last item"), li("Middle item"), li("First item") ).reversed(true); // Nested ordered list Ol ol4 = ol( li("Main item 1"), li( ol( li("Sub item 1.1"), li("Sub item 1.2") ) ), li("Main item 2") );

The following convenience methods are provided for constructing instances of this bean:

See Also:
  • Constructor Details

    • Ol

      public Ol()
      Creates an empty Ol element.
    • Ol

      public Ol(Object... children)
      Creates an Ol element with the specified child nodes.
      Parameters:
      children - The child nodes. Must not be null.
  • Method Details

    • reversed

      public Ol reversed(Object value)
      reversed attribute.

      Number the list backwards..

      This attribute uses deminimized values:

      • false - Attribute is not added
      • true - Attribute is added as "reversed"
      • Other values - Passed through as-is
      Parameters:
      value - The new value for this attribute. Typically a Boolean or String. Can be null to unset the attribute.
      Returns:
      This object.
    • start

      public Ol start(Object value)
      start attribute.

      Ordinal value of the first item.

      Parameters:
      value - The new value for this attribute. Typically a Number or String. Can be null to unset the attribute.
      Returns:
      This object.
    • type

      public Ol type(String value)
      type attribute.

      Specifies the type of numbering to use for the ordered list items.

      Possible values:

      • "1" - Decimal numbers (1, 2, 3, ...) - default
      • "a" - Lowercase letters (a, b, c, ...)
      • "A" - Uppercase letters (A, B, C, ...)
      • "i" - Lowercase Roman numerals (i, ii, iii, ...)
      • "I" - Uppercase Roman numerals (I, II, III, ...)
      Parameters:
      value - The type of numbering for the ordered list. Can be null to unset the attribute.
      Returns:
      This object.