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 forItemModel
s 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 void
doValidate(java.lang.Object model, InterceptorContext ctx)
This function replaces the onValidate method in sub-classes.protected ModelService
getModelService()
protected void
markItemsAsModified(java.util.List<ItemModel> items)
void
markParentItemsAsModified(ItemModel item)
void
onValidate(java.lang.Object model, InterceptorContext ctx)
Called in themodelService.saveAll()
method.void
setModelService(ModelService modelService)
-
-
-
Method Detail
-
onValidate
public final void onValidate(@Nonnull java.lang.Object model, @Nonnull InterceptorContext ctx) throws InterceptorException
Description copied from interface:ValidateInterceptor
Called in themodelService.saveAll()
method. Validates the values of the given model.- Specified by:
onValidate
in 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 InterceptorException
This 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)
-
-