Class ProductImagesValueResolver

  • All Implemented Interfaces:
    QualifierProviderAware, ValueResolver<ProductModel>

    public class ProductImagesValueResolver
    extends AbstractValueResolver<ProductModel,​java.util.Map<java.lang.String,​MediaModel>,​java.lang.Object>
    Resolver for product images urls. It selects the first gallery image that supports the requested media format. By default, if parameter mediaFormat is not specified, it tries to retrieve the media format from the indexed property name. By default it finds character "-" and treats following character sequence as a media format. If character "-" is not present, an exception of type FieldValueProviderException is thrown. The parsing method can be overridden.

    Supported parameters:

    Parameter Default value Description
    optional true If false, indicates that the resolved media url should not be null and not an empty string. If these conditions are not met, an exception of type FieldValueProviderException is thrown.
    mediaFormat If specified, this is the qualifier of the media format.