public class AmpImage extends AmpComponent
| Modifier and Type | Field and Description |
|---|---|
protected int |
defaultHeight
Default height of image.
|
protected int |
defaultWidth
Default width of image.
|
| Constructor and Description |
|---|
AmpImage(int width,
int height)
Create instance of AmpImage.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAlt()
A string of alternate text, similar to the alt attribute on img.
|
String |
getRequiredScript()
Required script that muct be added to head section.
|
String |
getSrc()
Similar to the src attribute on the img tag.
|
boolean |
isValid()
Indicates whether this image is valid of AmpImage.
|
void |
setAlt(String value)
A string of alternate text, similar to the alt attribute on img.
|
void |
setSrc(String value)
Similar to the src attribute on the img tag.
|
String |
toAmpHtml()
Represents amp html version of component.
|
String |
toHtml()
Represents html version of component.
|
getAttributes, getFallback, getPlaceholder, setFallback, setPlaceholderprotected int defaultWidth
Default width of image.
protected int defaultHeight
Default height of image.
public AmpImage(int width,
int height)
Create instance of AmpImage.
width - width of AmpImageheight - height of AmpImagepublic final String getSrc()
Similar to the src attribute on the img tag. The value must be a URL that points to a publicly-cacheable image file
public final void setSrc(String value)
Similar to the src attribute on the img tag. The value must be a URL that points to a publicly-cacheable image file
public final String getAlt()
A string of alternate text, similar to the alt attribute on img.
public final void setAlt(String value)
A string of alternate text, similar to the alt attribute on img.
public final boolean isValid()
Indicates whether this image is valid of AmpImage.
public String getRequiredScript()
Required script that muct be added to head section.
getRequiredScript in class AmpComponentpublic String toAmpHtml()
Represents amp html version of component.
toAmpHtml in class AmpComponentpublic String toHtml()
Represents html version of component.
toHtml in class AmpComponentCopyright (c) 2008-2024 Aspose Pty Ltd. All Rights Reserved.