Class DefaultFacadeValidationService

  • All Implemented Interfaces:
    FacadeValidationService

    public class DefaultFacadeValidationService
    extends java.lang.Object
    implements FacadeValidationService
    Default implementation of a facade level validation service. This service will create a new instance of the Errors, ensure that the given validator can support the object to be validated, then perform the validation.

    If any validation errors were found, then a ValidationException is thrown.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ErrorFactory getValidatorErrorFactory()  
      void setValidatorErrorFactory​(ErrorFactory validatorErrorFactory)  
      void validate​(org.springframework.validation.Validator validator, java.lang.Object validatee)
      Validate the given DTO.
      void validate​(org.springframework.validation.Validator validator, java.lang.Object validatee, java.lang.Object bindingObject)
      Validate the given DTO.
      protected void validateInternal​(org.springframework.validation.Validator validator, java.lang.Object validatee, org.springframework.validation.Errors errors)
      Validate the object using the provided binded errors
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultFacadeValidationService

        public DefaultFacadeValidationService()
    • Method Detail

      • validate

        public void validate​(org.springframework.validation.Validator validator,
                             java.lang.Object validatee)
                      throws ValidationException
        Description copied from interface: FacadeValidationService
        Validate the given DTO.
        Specified by:
        validate in interface FacadeValidationService
        Parameters:
        validator - - the validator to use for the validation
        validatee - - the object being validated
        Throws:
        ValidationException - when validation errors were found
      • validate

        public void validate​(org.springframework.validation.Validator validator,
                             java.lang.Object validatee,
                             java.lang.Object bindingObject)
                      throws ValidationException
        Description copied from interface: FacadeValidationService
        Validate the given DTO.
        Specified by:
        validate in interface FacadeValidationService
        Parameters:
        validator - - the validator to use for the validation
        validatee - - the object being validated
        bindingObject - - the object to use for binding the field errors
        Throws:
        ValidationException - when validation errors were found
      • validateInternal

        protected void validateInternal​(org.springframework.validation.Validator validator,
                                        java.lang.Object validatee,
                                        org.springframework.validation.Errors errors)
                                 throws ValidationException
        Validate the object using the provided binded errors
        Parameters:
        validator -
        validatee -
        errors -
        Throws:
        ValidationException
      • getValidatorErrorFactory

        protected ErrorFactory getValidatorErrorFactory()
      • setValidatorErrorFactory

        public void setValidatorErrorFactory​(ErrorFactory validatorErrorFactory)