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 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-classes.protected ModelServiceprotected voidmarkItemsAsModified(List<ItemModel> items) voidfinal voidonValidate(Object model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetModelService(ModelService modelService)
-
Constructor Details
-
AbstractParentChildValidateInterceptor
public AbstractParentChildValidateInterceptor()
-
-
Method Details
-
onValidate
public final void onValidate(@Nonnull Object model, @Nonnull InterceptorContext ctx) throws InterceptorException 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(@Nonnull Object model, @Nonnull InterceptorContext ctx) throws InterceptorException This function replaces the onValidate method in sub-classes.- Throws:
InterceptorException
-
markParentItemsAsModified
-
markItemsAsModified
-
getModelService
-
setModelService
-