Class SubtypeValidator
java.lang.Object
de.hybris.platform.webservicescommons.validators.SubtypeValidator
- All Implemented Interfaces:
org.springframework.validation.Validator
Subtype validator is a single class for validating type or any of its registered subtypes. It uses information from
subtypeRegistry to define for what types validators are needed and collects validators that supports those types
(marked with declared markerInterface). Validators should be just declared as spring bean and implement
markerInterface. markerInterface is needed to distinguish between validators that supports the same type but are
designed for different purposes e.g. create and update operation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?>protected Collection<org.springframework.validation.Validator> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<org.springframework.validation.Validator>findValidators(Collection<org.springframework.validation.Validator> validators) voidinit()voidsetMarkerInterface(Class<?> markerInterface) voidsetValidators(Collection<org.springframework.validation.Validator> validators) booleanvoid
-
Field Details
-
markerInterface
-
validators
-
-
Constructor Details
-
SubtypeValidator
public SubtypeValidator()
-
-
Method Details
-
init
@PostConstruct public void init() -
findValidators
protected Collection<org.springframework.validation.Validator> findValidators(Collection<org.springframework.validation.Validator> validators) -
supports
- Specified by:
supportsin interfaceorg.springframework.validation.Validator
-
validate
- Specified by:
validatein interfaceorg.springframework.validation.Validator
-
setValidators
@Autowired public void setValidators(Collection<org.springframework.validation.Validator> validators) -
setMarkerInterface
-