Class AbstractParentChildValidateInterceptor
- java.lang.Object
-
- de.hybris.platform.subscriptionservices.interceptor.impl.AbstractParentChildValidateInterceptor
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor
- Direct Known Subclasses:
ChargeEntryValidateInterceptor,OneTimeChargeEntryValidateInterceptor,OverageUsageChargeEntryValidateInterceptor,SubscriptionPricePlanValidateInterceptor,UsageChargeValidateInterceptor
public abstract class AbstractParentChildValidateInterceptor extends java.lang.Object implements ValidateInterceptor
Abstract interceptor forItemModels whose parent objects also need to be modified if they are modified. By implementing the function onValidate as final, one can make sure thatmarkParentItemsAsModified(de.hybris.platform.core.model.ItemModel)is called after all validations in the sub-classes have successfully passed.
-
-
Constructor Summary
Constructors Constructor Description AbstractParentChildValidateInterceptor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoValidate(java.lang.Object model, InterceptorContext ctx)This function replaces the onValidate method in sub-classes.protected ModelServicegetModelService()protected voidmarkItemsAsModified(java.util.List<ItemModel> items)voidmarkParentItemsAsModified(ItemModel item)voidonValidate(java.lang.Object model, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetModelService(ModelService modelService)
-
-
-
Method Detail
-
onValidate
public final void onValidate(@Nonnull java.lang.Object model, @Nonnull InterceptorContext ctx) throws InterceptorExceptionDescription 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(@Nonnull java.lang.Object model, @Nonnull InterceptorContext ctx) throws InterceptorExceptionThis function replaces the onValidate method in sub-classes.- Throws:
InterceptorException
-
markParentItemsAsModified
public void markParentItemsAsModified(ItemModel item)
-
markItemsAsModified
protected void markItemsAsModified(java.util.List<ItemModel> items)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
-