Interface Image
-
- All Superinterfaces:
Component
,ComponentExporter
@ConsumerType public interface Image extends Component
Defines theImage
Sling Model used for the/apps/core/wcm/components/image
component.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JSON_LAZY_ENABLED
Deprecated.since 12.1.0static java.lang.String
JSON_SMART_IMAGES
Deprecated.since 12.1.0static java.lang.String
JSON_SMART_SIZES
Deprecated.since 12.1.0static java.lang.String
PN_ALT_VALUE_FROM_DAM
Name of the configuration policy property that will indicate if the value of thealt
attribute should be populated from DAM if the component is configured with a file reference.static java.lang.String
PN_ALT_VALUE_FROM_PAGE_IMAGE
Name of the resource property that will indicate if the value of thealt
attribute should be inherited from the featured image of the page.static java.lang.String
PN_DESIGN_ALLOWED_RENDITION_WIDTHS
Name of the configuration policy property that will store the allowed rendition widths for an image.static java.lang.String
PN_DESIGN_ASSET_DELIVERY_ENABLED
Name of the configuration policy property that controls whether assets will be delivered through Dynamic Media.static java.lang.String
PN_DESIGN_DYNAMIC_MEDIA_ENABLED
Name of the configuration policy property that controls whether Dynamic Media features are used by Core component.static java.lang.String
PN_DESIGN_JPEG_QUALITY
Name of the configuration policy property that will store the image quality for an image.static java.lang.String
PN_DESIGN_LAZY_LOADING_ENABLED
Name of the configuration policy property that will indicate if lazy loading should be disabled.static java.lang.String
PN_DESIGN_LAZY_THRESHOLD
Name of the configuration policy property that indicate the number of pixels, in advance of becoming visible, that a lazy loading image should load.static java.lang.String
PN_DESIGN_RESIZE_WIDTH
Name of the configuration policy property that will be used for resizing the base images, the ones fromsrc
attribute.static java.lang.String
PN_DESIGN_SIZES
Name of the configuration policy property that will store the sizes attribute for a responsive image.static java.lang.String
PN_DISPLAY_POPUP_TITLE
Name of the resource property that will indicate if the image's caption will be rendered as a popup.static java.lang.String
PN_EXTERNAL_IMAGE_RESOURCE_PATH
Name of the resource property that will indicate if the image component should render an external image resource.static java.lang.String
PN_FLIP_HORIZONTAL
Name of the resource property that will indicate if the current image should be flipped horizontally.static java.lang.String
PN_FLIP_VERTICAL
Name of the resource property that will indicate if the current image should be flipped vertically.static java.lang.String
PN_IMAGE_FROM_PAGE_IMAGE
Name of the resource property that will indicate if the image is inherited from the featured image of the page.static java.lang.String
PN_IMAGE_MODIFIERS
Name of the resource property that will indicate if the current image should has Image Modifiers settings.static java.lang.String
PN_IMAGE_SERVER_URL
Name of the resource property that will indicate imageServerUrl.static java.lang.String
PN_IS_DECORATIVE
Name of the resource property that will indicate if the image is decorative.static java.lang.String
PN_MAP
Name of the resource property that defines areas of an image map.static java.lang.String
PN_TITLE_VALUE_FROM_DAM
Name of the configuration policy property that will indicate if the value of thetitle
attribute should be populated from DAM if the component is configured with a file reference.static java.lang.String
PN_UUID_DISABLED
Name of the policy property that defines whether or not the UUID is disabled.
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
displayPopupTitle()
Checks if the image should display its caption as a popup (through the<img>
title
attribute).default java.lang.String
getAlt()
Returns the value for thealt
attribute of the image.default java.util.List<ImageArea>
getAreas()
Returns a list of image map areas.default ImageData
getComponentData()
default java.lang.String
getFileReference()
Returns the file reference of the current image, if one exists.default java.lang.String
getHeight()
Returns the height of the base DAM asset image, the one from thesrc
attribute.default Link
getImageLink()
Returns the image's link.default java.lang.String
getJson()
Deprecated.since 12.1.0default int
getLazyThreshold()
Returns the number of pixels in advance of an image becoming visible that a lazy loading image should load.default java.lang.String
getLink()
Deprecated.Please usegetImageLink()
default @Nullable java.lang.String
getSizes()
Returns the media condition to indicate which image widths should be used, configured through thePN_DESIGN_SIZES
content policy.default java.lang.String
getSmartCropRendition()
default java.lang.String
getSrc()
Returns the value for thesrc
attribute of the image.default java.lang.String
getSrcset()
Returns the value for thesrcset
html attribute of the image.default java.lang.String
getSrcUriTemplate()
Returns a URI template representation of the image src attribute that can be variable expanded to a URI reference.default java.lang.String
getTitle()
Returns the value for the image'stitle
attribute, if one was set.default java.lang.String
getUuid()
Returns the value for the image's uuid, if one was set.default java.lang.String
getWidth()
Returns the width of the base DAM asset image, the one from thesrc
attribute.default @org.jetbrains.annotations.NotNull int[]
getWidths()
Returns the alternative image widths (in pixels), configured through thePN_DESIGN_ALLOWED_RENDITION_WIDTHS
content policy.default boolean
isDecorative()
Indicates whether the image is decorative.default boolean
isDmImage()
default boolean
isLazyEnabled()
Indicates if the image should be rendered lazily or not.-
Methods inherited from interface com.adobe.cq.wcm.core.components.models.Component
getAppliedCssClasses, getData, getExportedType, getId
-
-
-
-
Field Detail
-
PN_IMAGE_FROM_PAGE_IMAGE
static final java.lang.String PN_IMAGE_FROM_PAGE_IMAGE
Name of the resource property that will indicate if the image is inherited from the featured image of the page.- Since:
- com.adobe.cq.wcm.core.components.models 12.23.0
- See Also:
- Constant Field Values
-
PN_ALT_VALUE_FROM_PAGE_IMAGE
static final java.lang.String PN_ALT_VALUE_FROM_PAGE_IMAGE
Name of the resource property that will indicate if the value of thealt
attribute should be inherited from the featured image of the page.- Since:
- com.adobe.cq.wcm.core.components.models 12.23.0
- See Also:
- Constant Field Values
-
PN_DESIGN_ALLOWED_RENDITION_WIDTHS
static final java.lang.String PN_DESIGN_ALLOWED_RENDITION_WIDTHS
Name of the configuration policy property that will store the allowed rendition widths for an image.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
PN_DESIGN_SIZES
static final java.lang.String PN_DESIGN_SIZES
Name of the configuration policy property that will store the sizes attribute for a responsive image.- Since:
- com.adobe.cq.wcm.core.components.models 12.26.0
- See Also:
- Constant Field Values
-
PN_DESIGN_JPEG_QUALITY
static final java.lang.String PN_DESIGN_JPEG_QUALITY
Name of the configuration policy property that will store the image quality for an image.- Since:
- com.adobe.cq.wcm.core.components.models 12.5.0
- See Also:
- Constant Field Values
-
PN_DESIGN_LAZY_LOADING_ENABLED
static final java.lang.String PN_DESIGN_LAZY_LOADING_ENABLED
Name of the configuration policy property that will indicate if lazy loading should be disabled.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
PN_DESIGN_LAZY_THRESHOLD
static final java.lang.String PN_DESIGN_LAZY_THRESHOLD
Name of the configuration policy property that indicate the number of pixels, in advance of becoming visible, that a lazy loading image should load.- See Also:
- Constant Field Values
-
PN_IS_DECORATIVE
static final java.lang.String PN_IS_DECORATIVE
Name of the resource property that will indicate if the image is decorative.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
PN_UUID_DISABLED
static final java.lang.String PN_UUID_DISABLED
Name of the policy property that defines whether or not the UUID is disabled.- Since:
- com.adobe.cq.wcm.core.components.models 12.4.0
- See Also:
- Constant Field Values
-
PN_DISPLAY_POPUP_TITLE
static final java.lang.String PN_DISPLAY_POPUP_TITLE
Name of the resource property that will indicate if the image's caption will be rendered as a popup.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
PN_EXTERNAL_IMAGE_RESOURCE_PATH
static final java.lang.String PN_EXTERNAL_IMAGE_RESOURCE_PATH
Name of the resource property that will indicate if the image component should render an external image resource.- Since:
- com.adobe.cq.wcm.core.components.models 12.27.0
- See Also:
- Constant Field Values
-
JSON_SMART_SIZES
@Deprecated static final java.lang.String JSON_SMART_SIZES
Deprecated.since 12.1.0Name of the JSON property that will store the smart sizes for smart loading.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
JSON_SMART_IMAGES
@Deprecated static final java.lang.String JSON_SMART_IMAGES
Deprecated.since 12.1.0Name of the JSON property that will store the smart images for smart loading.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
JSON_LAZY_ENABLED
@Deprecated static final java.lang.String JSON_LAZY_ENABLED
Deprecated.since 12.1.0Name of the JSON property that will indicate if the image should be loaded lazily.- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0
- See Also:
- Constant Field Values
-
PN_ALT_VALUE_FROM_DAM
static final java.lang.String PN_ALT_VALUE_FROM_DAM
Name of the configuration policy property that will indicate if the value of thealt
attribute should be populated from DAM if the component is configured with a file reference.- Since:
- com.adobe.cq.wcm.core.components.models 12.2.0
- See Also:
- Constant Field Values
-
PN_TITLE_VALUE_FROM_DAM
static final java.lang.String PN_TITLE_VALUE_FROM_DAM
Name of the configuration policy property that will indicate if the value of thetitle
attribute should be populated from DAM if the component is configured with a file reference.- Since:
- com.adobe.cq.wcm.core.components.models 12.2.0
- See Also:
- Constant Field Values
-
PN_FLIP_HORIZONTAL
static final java.lang.String PN_FLIP_HORIZONTAL
Name of the resource property that will indicate if the current image should be flipped horizontally.- Since:
- com.adobe.cq.wcm.core.components.models 12.3.0
- See Also:
- Constant Field Values
-
PN_FLIP_VERTICAL
static final java.lang.String PN_FLIP_VERTICAL
Name of the resource property that will indicate if the current image should be flipped vertically.- Since:
- com.adobe.cq.wcm.core.components.models 12.3.0
- See Also:
- Constant Field Values
-
PN_IMAGE_MODIFIERS
static final java.lang.String PN_IMAGE_MODIFIERS
Name of the resource property that will indicate if the current image should has Image Modifiers settings.- See Also:
- Constant Field Values
-
PN_IMAGE_SERVER_URL
static final java.lang.String PN_IMAGE_SERVER_URL
Name of the resource property that will indicate imageServerUrl.- See Also:
- Constant Field Values
-
PN_MAP
static final java.lang.String PN_MAP
Name of the resource property that defines areas of an image map.The property stores map areas as follows: [area1][area2][...]
Area format: [SHAPE(COORDINATES)"HREF"|"TARGET"|"ALT"|(RELATIVE_COORDINATES)]
Example: [rect(0,0,10,10)"http://www.adobe.com"|"_self"|"alt"|(0,0,0.8,0.8)][circle(10,10,10)"http://www.adobe.com"|"_self"|"alt"|(0.8,0.8,0.8)]
- Since:
- com.adobe.cq.wcm.core.components.models 12.4.0
- See Also:
- Constant Field Values
-
PN_DESIGN_DYNAMIC_MEDIA_ENABLED
static final java.lang.String PN_DESIGN_DYNAMIC_MEDIA_ENABLED
Name of the configuration policy property that controls whether Dynamic Media features are used by Core component.- See Also:
- Constant Field Values
-
PN_DESIGN_ASSET_DELIVERY_ENABLED
static final java.lang.String PN_DESIGN_ASSET_DELIVERY_ENABLED
Name of the configuration policy property that controls whether assets will be delivered through Dynamic Media.- Since:
- com.adobe.cq.wcm.core.components.models 12.25.0
- See Also:
- Constant Field Values
-
PN_DESIGN_RESIZE_WIDTH
static final java.lang.String PN_DESIGN_RESIZE_WIDTH
Name of the configuration policy property that will be used for resizing the base images, the ones fromsrc
attribute.- Since:
- com.adobe.cq.wcm.core.components.models 12.23.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSrc
default java.lang.String getSrc()
Returns the value for thesrc
attribute of the image.- Returns:
- the image's URL
- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
getAlt
default java.lang.String getAlt()
Returns the value for thealt
attribute of the image.- Returns:
- the value for the image's
alt
attribute, if one was set, ornull
- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
getTitle
default java.lang.String getTitle()
Returns the value for the image'stitle
attribute, if one was set.- Returns:
- the value for the image's
title
attribute, if one was set, ornull
- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
getUuid
default java.lang.String getUuid()
Returns the value for the image's uuid, if one was set.- Returns:
- the value for the image's uuid, if one was set, or
null
- Since:
- com.adobe.cq.wcm.core.components.models 12.4.0;
-
getImageLink
default Link getImageLink()
Returns the image's link.- Returns:
- the image's link.
- Since:
- com.adobe.cq.wcm.core.components.models 12.20.0
-
getLink
@Deprecated default java.lang.String getLink()
Deprecated.Please usegetImageLink()
Returns the image's link URL, if one was set.- Returns:
- the image's link URL, if one was set, or
null
- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
displayPopupTitle
default boolean displayPopupTitle()
Checks if the image should display its caption as a popup (through the<img>
title
attribute).- Returns:
true
if the caption should be displayed as a popup,false
otherwise- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
getFileReference
default java.lang.String getFileReference()
Returns the file reference of the current image, if one exists.- Returns:
- the file reference of the current image, if one exists,
null
otherwise - Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
getJson
@Deprecated default java.lang.String getJson()
Deprecated.since 12.1.0Returns a JSON object used for the smart image functionality. The object provides the following properties:JSON_SMART_SIZES
- array of integers, representing the available image widthsJSON_SMART_IMAGES
- array of strings, providing the URLs for the available image renditionsJSON_LAZY_ENABLED
- boolean, specifying if the image should be rendered lazily or not
- Returns:
- the JSON for the smart image functionality
- Since:
- com.adobe.cq.wcm.core.components.models 11.0.0; marked
default
in 12.1.0
-
getWidths
@NotNull default @org.jetbrains.annotations.NotNull int[] getWidths()
Returns the alternative image widths (in pixels), configured through thePN_DESIGN_ALLOWED_RENDITION_WIDTHS
content policy. If no configuration is present, this method will return an empty array.- Returns:
- the alternative image widths (in pixels)
- Since:
- com.adobe.cq.wcm.core.components.models 12.2.0
-
getSizes
@Nullable default @Nullable java.lang.String getSizes()
Returns the media condition to indicate which image widths should be used, configured through thePN_DESIGN_SIZES
content policy.- Returns:
- the sizes media condition
- Since:
- com.adobe.cq.wcm.core.components.models 12.26.0
-
getSrcUriTemplate
default java.lang.String getSrcUriTemplate()
Returns a URI template representation of the image src attribute that can be variable expanded to a URI reference. Useful for building an alternative image configuration from the original src.- Returns:
- the image src URI template
- Since:
- com.adobe.cq.wcm.core.components.models 12.2.0
-
isLazyEnabled
default boolean isLazyEnabled()
Indicates if the image should be rendered lazily or not.- Returns:
- true if the image should be rendered lazily; false otherwise
- Since:
- com.adobe.cq.wcm.core.components.models 12.2.0
-
getSrcset
default java.lang.String getSrcset()
Returns the value for thesrcset
html attribute of the image.- Returns:
- the value of the
srcset
attribute, if one was set, ornull
. - Since:
- com.adobe.cq.wcm.core.components.models 12.21.0
-
getWidth
default java.lang.String getWidth()
Returns the width of the base DAM asset image, the one from thesrc
attribute. It will be used as value for thewidth
attribute of the image, only if the image is a DAM asset and is not SVG.- Returns:
- the width of the base DAM asset image, the one from the
src
attribute. - Since:
- com.adobe.cq.wcm.core.components.models 12.21.0;
-
getHeight
default java.lang.String getHeight()
Returns the height of the base DAM asset image, the one from thesrc
attribute. It will be used as value for theheight
attribute of the image, only if the image is a DAM asset and is not SVG.- Returns:
- the height of the base DAM asset image, the one from the
src
attribute. - Since:
- com.adobe.cq.wcm.core.components.models 12.21.0;
-
getLazyThreshold
default int getLazyThreshold()
Returns the number of pixels in advance of an image becoming visible that a lazy loading image should load.- Returns:
- The number of pixels.
-
getAreas
default java.util.List<ImageArea> getAreas()
Returns a list of image map areas.- Returns:
- the image map areas
- Since:
- com.adobe.cq.wcm.core.components.models 12.4.0
-
isDecorative
default boolean isDecorative()
Indicates whether the image is decorative.- Returns:
- true if the image is decorative; false otherwise
- Since:
- com.adobe.cq.wcm.core.components.models 12.11.0
-
getSmartCropRendition
default java.lang.String getSmartCropRendition()
-
isDmImage
default boolean isDmImage()
-
getComponentData
default ImageData getComponentData()
-
-