public class CodeGenerationConfigurationValidateInterceptor extends java.lang.Object implements ValidateInterceptor<CodeGenerationConfigurationModel>
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 and Description |
|---|
CodeGenerationConfigurationValidateInterceptor() |
public CodeGenerationConfigurationValidateInterceptor()
public void onValidate(CodeGenerationConfigurationModel model, InterceptorContext ctx) throws InterceptorException
ValidateInterceptormodelService.saveAll() method. Validates the values of the given model.onValidate in interface ValidateInterceptor<CodeGenerationConfigurationModel>model - the model which values has to be validatedctx - the InterceptorContextInterceptorException - if any values of the model are not valid.protected void validateCodeSeperator(CodeGenerationConfigurationModel model) throws InterceptorException
InterceptorException - throws exception if code seperator is not validprotected void validateCoupon(CodeGenerationConfigurationModel model) throws InterceptorException
InterceptorException - throws exception if coupon is not validprotected void validateTotalLength(int partCount,
int partLength)
throws InterceptorException
InterceptorException - throws exception of total length of coupon is not validprotected boolean checkModelAttributeValuesChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx)
protected boolean isCodeSeparattorChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx)
protected boolean isCouponPartCountChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx)
protected boolean isCouponPartLengthChanged(CodeGenerationConfigurationModel model, InterceptorContext ctx)
protected <T> T getPreviousValue(CodeGenerationConfigurationModel model, java.lang.String attributeName)
protected CouponCodeGenerationService getCouponCodeGenerationService()
public void setCouponCodeGenerationService(CouponCodeGenerationService couponCodeGenerationService)
protected CouponDao getCouponDao()
public void setCouponDao(CouponDao couponDao)
Copyright © 2018 SAP SE. All Rights Reserved.