Class TypeConstraintValidator
- java.lang.Object
-
- de.hybris.platform.validation.interceptors.TypeConstraintValidator
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<AbstractConstraintModel>
public class TypeConstraintValidator extends java.lang.Object implements ValidateInterceptor<AbstractConstraintModel>
Validator forTypeConstraintModel. The following settings are validated:AbstractConstraintModel.ANNOTATIONmust be set and must be an annotationAbstractConstraintModel.TARGETmust not benull- if
AbstractConstraintModel.TYPEisnullAbstractConstraintModel.TARGETmust not be assignalbe from ItemModel (only POJOs are allowed) - if
AbstractConstraintModel.TYPEandAbstractConstraintModel.TARGETare notnullboth must be related together
-
-
Constructor Summary
Constructors Constructor Description TypeConstraintValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonValidate(AbstractConstraintModel constraint, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetModelService(ModelService modelService)
-
-
-
Method Detail
-
onValidate
public void onValidate(AbstractConstraintModel constraint, InterceptorContext ctx) throws InterceptorException
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<AbstractConstraintModel>- Parameters:
constraint- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
setModelService
public void setModelService(ModelService modelService)
-
-