Class CodeGenerationConfigurationValidateInterceptor
java.lang.Object
de.hybris.platform.couponservices.interceptor.CodeGenerationConfigurationValidateInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<CodeGenerationConfigurationModel>
public class CodeGenerationConfigurationValidateInterceptor
extends Object
implements ValidateInterceptor<CodeGenerationConfigurationModel>
CodeGenerationConfigurationValidateInterceptor validates the
codeSeparator and that couponPartCount
and couponPartLength are within the defined limits (both > 0, product of both between 4 and 40 (more
formally: 4 <= (codePartCount * codePartLength) <= 40 ).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected CouponCodeGenerationServiceprotected CouponDaoprotected L10NServiceprotected <T> TgetPreviousValue(CodeGenerationConfigurationModel model, String attributeName) protected booleanprotected booleanprotected booleanvoidCalled in themodelService.saveAll()method.voidsetCouponCodeGenerationService(CouponCodeGenerationService couponCodeGenerationService) voidsetCouponDao(CouponDao couponDao) voidsetL10NService(L10NService l10NService) protected voidprotected voidprotected voidvalidateTotalLength(int partCount, int partLength)
-
Constructor Details
-
CodeGenerationConfigurationValidateInterceptor
public CodeGenerationConfigurationValidateInterceptor()
-
-
Method Details
-
onValidate
public void onValidate(CodeGenerationConfigurationModel model, InterceptorContext ctx) throws InterceptorException Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<CodeGenerationConfigurationModel>- Parameters:
model- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
validateCodeSeperator
protected void validateCodeSeperator(CodeGenerationConfigurationModel model) throws InterceptorException - Throws:
InterceptorException- throws exception if code seperator is not valid
-
validateCoupon
- Throws:
InterceptorException- throws exception if coupon is not valid
-
validateTotalLength
- Throws:
InterceptorException- throws exception of total length of coupon is not valid
-
checkModelAttributeValuesChanged
protected boolean checkModelAttributeValuesChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx) -
isCodeSeparattorChanged
protected boolean isCodeSeparattorChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx) -
isCouponPartCountChanged
protected boolean isCouponPartCountChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx) -
isCouponPartLengthChanged
protected boolean isCouponPartLengthChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx) -
getPreviousValue
-
getCouponCodeGenerationService
-
setCouponCodeGenerationService
-
getCouponDao
-
setCouponDao
-
getL10NService
-
setL10NService
-