Class Image

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.jdom2.NamespaceAware, org.jdom2.Parent

    @ProviderType
    public final class Image
    extends HtmlElement
    Html image (img) element.
    See Also:
    Serialized Form
    • Constructor Detail

      • Image

        public Image()
        Initializes html element.
      • Image

        public Image​(java.lang.String src)
        Initializes html element.
        Parameters:
        src - Html "src" attribute.
      • Image

        public Image​(java.lang.String src,
                     java.lang.String alt)
        Initializes html element.
        Parameters:
        src - Html "src" attribute.
        alt - Html "alt" attribute.
      • Image

        public Image​(java.lang.String src,
                     long width,
                     long height)
        Initializes html element.
        Parameters:
        src - Html "src" attribute.
        width - Html "width" attribute.
        height - Html "height" attribute.
      • Image

        public Image​(java.lang.String src,
                     java.lang.String alt,
                     long width,
                     long height)
        Initializes html element.
        Parameters:
        src - Html "src" attribute.
        alt - Html "alt" attribute.
        width - Html "width" attribute.
        height - Html "height" attribute.
    • Method Detail

      • getSrc

        public java.lang.String getSrc()
        Html "src" attribute.
        Returns:
        Value of attribute
      • setSrc

        public Image setSrc​(java.lang.String value)
        Html "src" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getSrcSet

        public java.lang.String getSrcSet()
        Html "srcset" attribute.
        Returns:
        Value of attribute
      • setSrcSet

        public Image setSrcSet​(java.lang.String value)
        Html "srcset" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getSizes

        public java.lang.String getSizes()
        Html "sizes" attribute.
        Returns:
        Value of attribute
      • setSizes

        public Image setSizes​(java.lang.String value)
        Html "sizes" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getAlt

        public java.lang.String getAlt()
        Html "alt" attribute.
        Returns:
        Value of attribute
      • setAlt

        public Image setAlt​(java.lang.String value)
        Html "alt" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getWidth

        public long getWidth()
        Html "width" attribute.
        Returns:
        Value of attribute
      • setWidth

        public Image setWidth​(long value)
        Html "width" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getHeight

        public long getHeight()
        Html "height" attribute.
        Returns:
        Value of attribute
      • setHeight

        public Image setHeight​(long value)
        Html "height" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getBorder

        public int getBorder()
        Html "border" attribute.
        Returns:
        Value of attribute
      • setBorder

        public Image setBorder​(int value)
        Html "border" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getHSpace

        public int getHSpace()
        Html "hspace" attribute.
        Returns:
        Value of attribute
      • setHSpace

        public Image setHSpace​(int value)
        Html "hspace" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getVSpace

        public int getVSpace()
        Html "vspace" attribute.
        Returns:
        Value of attribute
      • setVSpace

        public Image setVSpace​(int value)
        Html "vspace" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • getUseMap

        public java.lang.String getUseMap()
        Html "usemap" attribute.
        Returns:
        Value of attribute
      • setUseMap

        public Image setUseMap​(java.lang.String value)
        Html "usemap" attribute.
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • setEmptyAttributeValueAsBoolean

        protected Image setEmptyAttributeValueAsBoolean​(java.lang.String attributeName,
                                                        boolean value)
        Description copied from class: HtmlElement
        Sets "empty" attribute value as boolean (i.e. for "checked" attribute).
        Overrides:
        setEmptyAttributeValueAsBoolean in class HtmlElement
        Parameters:
        attributeName - Attribute name
        value - Attribute value as boolean
        Returns:
        Self reference
      • setId

        public Image setId​(java.lang.String value)
        Description copied from class: HtmlElement
        Html "id" attribute.
        Overrides:
        setId in class HtmlElement
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • setCssClass

        public Image setCssClass​(java.lang.String value)
        Description copied from class: HtmlElement
        Sets Html "class" attribute - unless you're really sure that you want to replace existing classes, you probably should call HtmlElement.addCssClass(String) instead.
        Overrides:
        setCssClass in class HtmlElement
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • addCssClass

        public Image addCssClass​(java.lang.String value)
        Description copied from class: HtmlElement
        Html "class" attribute. Adds a single, space-separated value while preserving existing ones.
        Overrides:
        addCssClass in class HtmlElement
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • setStyleString

        public Image setStyleString​(java.lang.String value)
        Description copied from class: HtmlElement
        Html "style" attribute.
        Overrides:
        setStyleString in class HtmlElement
        Parameters:
        value - Value of attribute with style key/value pairs
        Returns:
        Self reference
      • setStyle

        public Image setStyle​(java.lang.String styleAttribute,
                              java.lang.String styleValue)
        Description copied from class: HtmlElement
        Html "style" attribute. Sets single style attribute value.
        Overrides:
        setStyle in class HtmlElement
        Parameters:
        styleAttribute - Style attribute name
        styleValue - Style attribute value
        Returns:
        Self reference
      • setTitle

        public Image setTitle​(java.lang.String value)
        Description copied from class: HtmlElement
        Html "title" attribute.
        Overrides:
        setTitle in class HtmlElement
        Parameters:
        value - Value of attribute
        Returns:
        Self reference
      • setData

        public Image setData​(java.lang.String attributeName,
                             java.lang.String value)
        Description copied from class: HtmlElement
        Custom Html5 "data-*" attribute.
        Overrides:
        setData in class HtmlElement
        Parameters:
        attributeName - Name of HTML5 data attribute (without the 'data-' prefix).
        value - Value of attribute
        Returns:
        Self reference
      • setAttributeValueAsLong

        public Image setAttributeValueAsLong​(java.lang.String name,
                                             long value)
        Description copied from class: AbstractElement
        Sets attribute value as long.
        Overrides:
        setAttributeValueAsLong in class AbstractElement
        Parameters:
        name - Attribute name
        value - Attribute value as long
        Returns:
        Self reference
      • setText

        public Image setText​(java.lang.String text)
        Description copied from class: AbstractElement
        Sets the content of the element to be the text given. All existing text content and non-text context is removed. If this element should have both textual content and nested elements, use Element.setContent(java.util.Collection<? extends org.jdom2.Content>) instead. Setting a null text value is equivalent to setting an empty string value.
        Overrides:
        setText in class AbstractElement
        Parameters:
        text - new text content for the element
        Returns:
        the target element