Class CountryAwareAddressDTOValidator

  • All Implemented Interfaces:
    org.springframework.validation.Validator

    public class CountryAwareAddressDTOValidator
    extends java.lang.Object
    implements org.springframework.validation.Validator
    Implementation of Validator that validate instances of AddressWsDTO. The CountryAwareAddressValidator does not validate all fields itself, but delegates to other Validators countrySpecificAddressWsDTOValidators. AddressValidator uses the country.isocode field to select a suitable validator for a specific country. If a matching validator cannot be found, commonAddressWsDTOValidator is used.
    • Constructor Detail

      • CountryAwareAddressDTOValidator

        public CountryAwareAddressDTOValidator()
    • Method Detail

      • supports

        public boolean supports​(java.lang.Class clazz)
        Specified by:
        supports in interface org.springframework.validation.Validator
      • validate

        public void validate​(java.lang.Object target,
                             org.springframework.validation.Errors errors)
        Specified by:
        validate in interface org.springframework.validation.Validator
      • setCommonAddressValidator

        public void setCommonAddressValidator​(org.springframework.validation.Validator commonAddressValidator)
      • getCommonAddressValidator

        protected org.springframework.validation.Validator getCommonAddressValidator()
      • setCountrySpecificAddressValidators

        public void setCountrySpecificAddressValidators​(java.util.Map<java.lang.String,​org.springframework.validation.Validator> customAddressValidators)
      • getCountrySpecificAddressValidators

        protected java.util.Map<java.lang.String,​org.springframework.validation.Validator> getCountrySpecificAddressValidators()