Package io.wcm.handler.media.spi
Interface MediaMarkupBuilder
- All Known Implementing Classes:
AbstractImageMediaMarkupBuilder,DamVideoMediaMarkupBuilder,DummyImageMediaMarkupBuilder,SimpleImageMediaMarkupBuilder
@ConsumerType
public interface MediaMarkupBuilder
Builds XHTML markup for media element.
This interface has to be implemented by a Sling Model class. The adaptables
should be SlingHttpServletRequest and Resource.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull StringDummy imagestatic final intTry to render dummy image with least with this dimension. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this builder can generate markup for the given media.@Nullable io.wcm.handler.commons.dom.HtmlElementBuild media element markupbooleanisValidMedia(@NotNull io.wcm.handler.commons.dom.HtmlElement element) Checks if the given HTML element is valid.
-
Field Details
-
DUMMY_IMAGE
Dummy image- See Also:
-
DUMMY_MIN_DIMENSION
static final int DUMMY_MIN_DIMENSIONTry to render dummy image with least with this dimension.- See Also:
-
-
Method Details
-
accepts
Checks whether this builder can generate markup for the given media.- Parameters:
media- Media metadata- Returns:
- true if this markup builder can handle the given media
-
build
Build media element markup- Parameters:
media- Media metadata- Returns:
- Media element or null if media is invalid
-
isValidMedia
boolean isValidMedia(@NotNull @NotNull io.wcm.handler.commons.dom.HtmlElement element) Checks if the given HTML element is valid. It is treated as invalid if it is null, or if it is a simple IMG element containing the dummy image.- Parameters:
element- Media markup element.- Returns:
- true if media element is invalid
-