Class TypeConstraintValidator
java.lang.Object
de.hybris.platform.validation.interceptors.TypeConstraintValidator
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<AbstractConstraintModel>
public class TypeConstraintValidator
extends Object
implements ValidateInterceptor<AbstractConstraintModel>
Validator for
TypeConstraintModel. 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidonValidate(AbstractConstraintModel constraint, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetModelService(ModelService modelService)
-
Constructor Details
-
TypeConstraintValidator
public TypeConstraintValidator()
-
-
Method Details
-
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
-