Class Embed


@Marshalled(typeName="embed") public class Embed extends HtmlElementVoid<Embed>
DTO for an HTML <embed> element.

The embed element represents an integration point for an external application or interactive content. It is used to embed content such as Flash applications, PDF documents, or other multimedia content that requires a plugin or external application to display.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Embed a PDF document Embed embed1 = embed() .src("document.pdf") .type("application/pdf") .width("800") .height("600"); // Embed a Flash application Embed embed2 = embed() .src("game.swf") .type("application/x-shockwave-flash") .width("640") .height("480"); // Embed with fallback content Embed embed3 = embed() .src("interactive-content.swf") .type("application/x-shockwave-flash") .children( p("Your browser does not support embedded content.") );

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

See Also:
  • Constructor Details

    • Embed

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

      public Embed(Object src)
      Creates an Embed element with the specified src(Object) attribute.
      Parameters:
      src - The src(Object) attribute. Can be null, in which case the attribute is stored with a null value (not removed).
  • Method Details

    • height

      public Embed 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.
    • src

      public Embed src(Object value)
      src attribute.

      Address of the resource.

      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 new value for this attribute. Typically a URL or String. Can be null, in which case the attribute is stored with a null value (not removed).
      Returns:
      This object.
    • type

      public Embed type(String value)
      type attribute.

      Specifies the MIME type of the embedded resource. Helps browsers determine how to handle the resource.

      Common values:

      • "application/pdf" - PDF document
      • "application/x-shockwave-flash" - Flash content
      • "image/svg+xml" - SVG image
      • "video/mp4" - MP4 video
      • "audio/mp3" - MP3 audio
      Parameters:
      value - The MIME type of the embedded resource. Can be null to unset the attribute.
      Returns:
      This object.
    • width

      public Embed 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.