Class GenericVariantProductValidateInterceptor
- java.lang.Object
-
- de.hybris.platform.variants.interceptor.GenericVariantProductValidateInterceptor
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<GenericVariantProductModel>
public class GenericVariantProductValidateInterceptor extends java.lang.Object implements ValidateInterceptor<GenericVariantProductModel>
This interceptor ensures the following rules are fulfilled for a givenVariantValueCategory- 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 Constructor Description GenericVariantProductValidateInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected L10NServicegetL10NService()protected SessionServicegetSessionService()voidonValidate(GenericVariantProductModel genericVariant, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetL10NService(L10NService l10NService)voidsetSessionService(SessionService sessionService)protected voidvalidateBaseProductSuperCategories(GenericVariantProductModel genericVariant, java.util.Collection<CategoryModel> variantValueCategories)protected voidvalidateSupercategories(java.util.Collection<CategoryModel> superCategories)
-
-
-
Method Detail
-
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, java.util.Collection<CategoryModel> variantValueCategories) throws InterceptorException
- Throws:
InterceptorException
-
validateSupercategories
protected void validateSupercategories(java.util.Collection<CategoryModel> superCategories) throws InterceptorException
- Throws:
InterceptorException
-
getL10NService
protected L10NService getL10NService()
-
setL10NService
public void setL10NService(L10NService l10NService)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
-