Class Meter


@Marshalled(typeName="meter") public class Meter extends HtmlElementMixed<Meter>
DTO for an HTML <meter> element.

The meter element represents a scalar measurement within a known range, or a fractional value. It is used to display a gauge or meter showing a value within a defined range, such as disk usage, memory usage, or progress. The meter element is not suitable for representing a range of values (use the input element with type="range" for that). It is typically rendered as a visual gauge or bar that shows the current value relative to the minimum and maximum values.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple meter Meter simple = meter() .value(50) .min(0) .max(100); // Meter with styling Meter styled = meter() .class_("progress-meter") .value(75) .min(0) .max(100); // Meter with complex content Meter complex = meter() .value(60) .min(0) .max(100) .low(25) .high(75) .optimum(50); // Meter with ID Meter withId = meter() .id("disk-usage") .value(80) .min(0) .max(100); // Meter with styling Meter styled2 = meter() .style("width: 200px; height: 20px;") .value(40) .min(0) .max(100); // Meter with multiple attributes Meter multiple = meter() .value(85) .min(0) .max(100) .low(20) .high(80) .optimum(50) .title("Disk Usage: 85%"); // Meter with form Meter withForm = new Meter() .form("usage-form") .value(30) .min(0) .max(100);

See Also:
  • Constructor Details

    • Meter

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

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

    • high

      public Meter high(Object value)
      high attribute.

      Low limit of high range.

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

      public Meter low(Object value)
      low attribute.

      High limit of low range.

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

      public Meter max(Object value)
      max attribute.

      Upper bound of range.

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

      public Meter min(Object value)
      min attribute.

      Lower bound of range.

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

      public Meter optimum(Object value)
      optimum attribute.

      Optimum value in gauge.

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

      public Meter value(Object value)
      value attribute.

      Current value of the element.

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