Package io.wcm.handler.media
Class MediaComponentPropertyResolver
- java.lang.Object
-
- io.wcm.handler.media.MediaComponentPropertyResolver
-
- All Implemented Interfaces:
java.lang.AutoCloseable
@ProviderType public final class MediaComponentPropertyResolver extends java.lang.Object implements java.lang.AutoCloseable
Resolves Media Handler component properties for the component associated with the given resource from content policies and properties defined in the component resource. Please make sure toclose()
instances of this class after usage.Alternatively, it's possible to use the resolver on a ValueMap. In this case, the properties are directly read from the provided value map. Picture Sources are not supported for that option.
-
-
Constructor Summary
Constructors Constructor Description MediaComponentPropertyResolver(@NotNull org.apache.sling.api.resource.Resource resource, @NotNull io.wcm.wcm.commons.component.ComponentPropertyResolverFactory componentPropertyResolverFactory)
ResolvesMediaComponentPropertyResolver(@NotNull org.apache.sling.api.resource.ValueMap valueMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
@Nullable MediaArgs.ImageSizes
getImageSizes()
@NotNull java.lang.String @Nullable []
getMandatoryMediaFormatNames()
@NotNull java.lang.String @Nullable []
getMediaFormatNames()
@NotNull MediaArgs.MediaFormatOption @Nullable []
getMediaFormatOptions()
@NotNull MediaArgs.PictureSource @Nullable []
getPictureSources()
boolean
isAutoCrop()
-
-
-
Constructor Detail
-
MediaComponentPropertyResolver
public MediaComponentPropertyResolver(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, @NotNull @NotNull io.wcm.wcm.commons.component.ComponentPropertyResolverFactory componentPropertyResolverFactory)
Resolves- Parameters:
resource
- ResourcecomponentPropertyResolverFactory
- Component property resolver factory
-
MediaComponentPropertyResolver
public MediaComponentPropertyResolver(@NotNull @NotNull org.apache.sling.api.resource.ValueMap valueMap)
- Parameters:
valueMap
- Value map to read properties directly from
-
-
Method Detail
-
isAutoCrop
public boolean isAutoCrop()
- Returns:
- AutoCrop state
-
getMediaFormatOptions
@NotNull public @NotNull MediaArgs.MediaFormatOption @Nullable [] getMediaFormatOptions()
- Returns:
- List of media formats with and without mandatory setting.
-
getMediaFormatNames
@NotNull public @NotNull java.lang.String @Nullable [] getMediaFormatNames()
- Returns:
- List of media formats with and without mandatory setting.
-
getMandatoryMediaFormatNames
@NotNull public @NotNull java.lang.String @Nullable [] getMandatoryMediaFormatNames()
- Returns:
- List of media formats with and without mandatory setting.
-
getImageSizes
@Nullable public @Nullable MediaArgs.ImageSizes getImageSizes()
- Returns:
- Image sizes
-
getPictureSources
@NotNull public @NotNull MediaArgs.PictureSource @Nullable [] getPictureSources()
- Returns:
- List of picture sources
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-