Class CodeGenerationConfigurationValidateInterceptor
- java.lang.Object
-
- de.hybris.platform.couponservices.interceptor.CodeGenerationConfigurationValidateInterceptor
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<CodeGenerationConfigurationModel>
public class CodeGenerationConfigurationValidateInterceptor extends java.lang.Object implements ValidateInterceptor<CodeGenerationConfigurationModel>
CodeGenerationConfigurationValidateInterceptor validates thecodeSeparatorand thatcouponPartCountandcouponPartLengthare within the defined limits (both > 0, product of both between 4 and 40 (more formally:4 <= (codePartCount * codePartLength) <= 40).
-
-
Constructor Summary
Constructors Constructor Description CodeGenerationConfigurationValidateInterceptor()
-
Method Summary
-
-
-
Method Detail
-
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
protected void validateCoupon(CodeGenerationConfigurationModel model) throws InterceptorException
- Throws:
InterceptorException- throws exception if coupon is not valid
-
validateTotalLength
protected void validateTotalLength(int partCount, int partLength) throws InterceptorException- 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
protected <T> T getPreviousValue(CodeGenerationConfigurationModel model, java.lang.String attributeName)
-
getCouponCodeGenerationService
protected CouponCodeGenerationService getCouponCodeGenerationService()
-
setCouponCodeGenerationService
public void setCouponCodeGenerationService(CouponCodeGenerationService couponCodeGenerationService)
-
getCouponDao
protected CouponDao getCouponDao()
-
setCouponDao
public void setCouponDao(CouponDao couponDao)
-
-