Class AbstractParentChildValidateInterceptor
java.lang.Object
de.hybris.platform.entitlementservices.interceptor.impl.AbstractParentChildValidateInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor
- Direct Known Subclasses:
ProductEntitlementValidateInterceptor
public abstract class AbstractParentChildValidateInterceptor
extends Object
implements ValidateInterceptor
Abstract interceptor for
ItemModels
whose parent objects also need to be modified if they are modified. By
implementing the function onValidate as final, one can make sure that
markParentItemsAsModified(de.hybris.platform.core.model.ItemModel) is called
after all validations in the sub-classes have successfully passed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoValidate(Object model, InterceptorContext ctx) This function replaces the onValidate method in sub-classesprotected ModelServiceprotected voidmarkItemsAsModified(List<ItemModel> items) protected voidfinal voidonValidate(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetModelService(ModelService modelService)
-
Constructor Details
-
AbstractParentChildValidateInterceptor
public AbstractParentChildValidateInterceptor()
-
-
Method Details
-
onValidate
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor- Parameters:
model- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
doValidate
protected abstract void doValidate(Object model, InterceptorContext ctx) throws InterceptorException This function replaces the onValidate method in sub-classes- Throws:
InterceptorException
-
markParentItemsAsModified
-
markItemsAsModified
-
getModelService
-
setModelService
-