Class GenericVariantProductValidateInterceptor
java.lang.Object
de.hybris.platform.variants.interceptor.GenericVariantProductValidateInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<GenericVariantProductModel>
public class GenericVariantProductValidateInterceptor
extends Object
implements ValidateInterceptor<GenericVariantProductModel>
This interceptor ensures the following rules are fulfilled for a given
VariantValueCategory - there can be only one super category of type
VariantCategory and this super category is not optional - it can't have any other Categories (normal ones) as super
categories.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected L10NServiceprotected SessionServicevoidonValidate(GenericVariantProductModel genericVariant, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetL10NService(L10NService l10NService) voidsetSessionService(SessionService sessionService) protected voidvalidateBaseProductSuperCategories(GenericVariantProductModel genericVariant, Collection<CategoryModel> variantValueCategories) protected voidvalidateSupercategories(Collection<CategoryModel> superCategories)
-
Constructor Details
-
GenericVariantProductValidateInterceptor
public GenericVariantProductValidateInterceptor()
-
-
Method Details
-
onValidate
public void onValidate(GenericVariantProductModel genericVariant, InterceptorContext ctx) throws InterceptorException Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<GenericVariantProductModel>- Parameters:
genericVariant- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
validateBaseProductSuperCategories
protected void validateBaseProductSuperCategories(GenericVariantProductModel genericVariant, Collection<CategoryModel> variantValueCategories) throws InterceptorException - Throws:
InterceptorException
-
validateSupercategories
protected void validateSupercategories(Collection<CategoryModel> superCategories) throws InterceptorException - Throws:
InterceptorException
-
getL10NService
-
setL10NService
-
getSessionService
-
setSessionService
-