Class SubtypeValidator

java.lang.Object
de.hybris.platform.webservicescommons.validators.SubtypeValidator
All Implemented Interfaces:
org.springframework.validation.Validator

public class SubtypeValidator extends Object implements 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 Details

    • markerInterface

      protected Class<?> markerInterface
    • validators

      protected Collection<org.springframework.validation.Validator> 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

      public boolean supports(Class<?> clazz)
      Specified by:
      supports in interface org.springframework.validation.Validator
    • validate

      public void validate(Object object, org.springframework.validation.Errors errors)
      Specified by:
      validate in interface org.springframework.validation.Validator
    • setValidators

      @Autowired public void setValidators(Collection<org.springframework.validation.Validator> validators)
    • setMarkerInterface

      public void setMarkerInterface(Class<?> markerInterface)