Class Object_


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

The object element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin. It is commonly used to embed multimedia content such as Flash applications, PDFs, images, videos, or other HTML documents. While historically used for plugins, modern web development often prefers more specific elements like img, video, audio, or iframe when appropriate.

Examples:

// PDF document Object_ pdf = object() .data("/documents/manual.pdf") .type("application/pdf") .width("600") .height("800") .children(p("Your browser doesn't support PDF viewing.")); // SVG image Object_ svg = object() .data("/images/diagram.svg") .type("image/svg+xml") .width("400") .height("300"); // Embedded HTML page Object_ html = object() .data("/external/page.html") .type("text/html") .width("100%") .height("500"); // Flash content (legacy) Object_ flash = object() .data("/media/animation.swf") .type("application/x-shockwave-flash") .width("800") .height("600") .children( param().name("quality").value("high"), param().name("bgcolor").value("#ffffff"), p("Flash is not supported by your browser.") ); // Image with fallback Object_ image = object() .data("/images/photo.jpg") .type("image/jpeg") .width("640") .height("480") .children(img().src("/images/fallback.jpg").alt("Photo")); // With usemap for image map Object_ mapped = object() .data("/images/map.jpg") .type("image/jpeg") .usemap("#imagemap");

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

See Also:
  • Constructor Details

    • Object_

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

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

    • data

      public Object_ data(String value)
      data attribute.

      Specifies the URL of the resource to be embedded. This is the primary source of content for the object element.

      The value can be of any of the following types: URI, URL, String. Strings must be valid URIs.

      URIs defined by UriResolver can be used for values.

      Parameters:
      value - The URL of the resource to be embedded. Can be null to unset the attribute.
      Returns:
      This object.
    • form

      public Object_ form(String value)
      form attribute.

      Associates the control with a form element.

      Parameters:
      value - The new value for this attribute. Can be null to unset the attribute.
      Returns:
      This object.
    • height

      public Object_ height(Object value)
      height attribute.

      Vertical dimension.

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

      public Object_ name(String value)
      name attribute.

      Name of nested browsing context.

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

      public Object_ type(String value)
      type attribute.

      Type of embedded resource.

      Parameters:
      value - The new value for this attribute. Can be null to unset the attribute.
      Returns:
      This object.
    • typemustmatch

      public Object_ typemustmatch(Object value)
      typemustmatch attribute.

      Whether the type attribute and the Content-Type value need to match for the resource to be used.

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

      public Object_ usemap(String value)
      usemap attribute.

      Name of image map to use.

      Parameters:
      value - The new value for this attribute. Can be null to unset the attribute.
      Returns:
      This object.
    • width

      public Object_ width(Object value)
      width attribute.

      Horizontal dimension.

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