Package io.wcm.handler.media
Interface Asset
-
- All Superinterfaces:
org.apache.sling.api.adapter.Adaptable
@ProviderType public interface Asset extends org.apache.sling.api.adapter.AdaptableRepresents a media item that is referenced via aMediaRequestand resolved viaMediaHandler. It cannot be rendered directly, but contains references to renditions depending onMediaArgs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @Nullable StringgetAltText()@Nullable RenditiongetDefaultRendition()Get the default rendition without specifying and media args.@Nullable StringgetDescription()@Nullable RenditiongetDownloadRendition(@NotNull MediaArgs mediaArgs)Get the first download rendition that matches the given media args.@Nullable RenditiongetFlashRendition(@NotNull MediaArgs mediaArgs)Deprecated.Flash support is deprecated@Nullable RenditiongetImageRendition(@NotNull MediaArgs mediaArgs)Get the first image rendition that matches the given media args.@NotNull StringgetPath()Internal path pointing to media item, if it is stored in the JCR repository.@NotNull org.apache.sling.api.resource.ValueMapgetProperties()@Nullable RenditiongetRendition(@NotNull MediaArgs mediaArgs)Get the first rendition that matches the given media args.@Nullable StringgetTitle()
-
-
-
Method Detail
-
getTitle
@Nullable @Nullable String getTitle()
- Returns:
- Title of media item
-
getAltText
@Nullable @Nullable String getAltText()
- Returns:
- Alternative text for media item
-
getDescription
@Nullable @Nullable String getDescription()
- Returns:
- Description for this media item
-
getPath
@NotNull @NotNull String getPath()
Internal path pointing to media item, if it is stored in the JCR repository.- Returns:
- Repository path
-
getProperties
@NotNull @NotNull org.apache.sling.api.resource.ValueMap getProperties()
- Returns:
- Properties of media item
-
getDefaultRendition
@Nullable @Nullable Rendition getDefaultRendition()
Get the default rendition without specifying and media args.- Returns:
Renditioninstance or null if no rendition exists
-
getRendition
@Nullable @Nullable Rendition getRendition(@NotNull @NotNull MediaArgs mediaArgs)
Get the first rendition that matches the given media args.- Parameters:
mediaArgs- Media args to filter specific media formats or extensions.- Returns:
Renditionfor the first matching rendition or null if no match found.
-
getImageRendition
@Nullable @Nullable Rendition getImageRendition(@NotNull @NotNull MediaArgs mediaArgs)
Get the first image rendition that matches the given media args.- Parameters:
mediaArgs- Media args to filter specific media formats or extensions.- Returns:
Renditionfor the first matching rendition or null if no match found.
-
getFlashRendition
@Deprecated @Nullable @Nullable Rendition getFlashRendition(@NotNull @NotNull MediaArgs mediaArgs)
Deprecated.Flash support is deprecatedGet the first flash rendition that matches the given media args.- Parameters:
mediaArgs- Media args to filter specific media formats or extensions.- Returns:
Renditionfor the first matching rendition or null if no match found.
-
getDownloadRendition
@Nullable @Nullable Rendition getDownloadRendition(@NotNull @NotNull MediaArgs mediaArgs)
Get the first download rendition that matches the given media args.- Parameters:
mediaArgs- Media args to filter specific media formats or extensions.- Returns:
Renditionfor the first matching rendition or null if no match found.
-
-