Class ValidatorImpl

    • Method Detail

      • getConstraintsForClass

        public jakarta.validation.metadata.BeanDescriptor getConstraintsForClass​(Class<?> clazz)
        Specified by:
        getConstraintsForClass in interface jakarta.validation.Validator
      • validate

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validate​(T object,
                                                                           Class<?>... groups)
        Specified by:
        validate in interface jakarta.validation.Validator
      • validateProperty

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateProperty​(T object,
                                                                                   String propertyName,
                                                                                   boolean cascade,
                                                                                   Class<?>... groups)
        Description copied from interface: CascadingPropertyValidator
        Validates all constraints placed on the property of object named propertyName.
        Specified by:
        validateProperty in interface CascadingPropertyValidator
        Parameters:
        object - object to validate
        propertyName - property to validate (i.e. field and getter constraints). Nested properties may be referenced (e.g. prop[2].subpropA.subpropB)
        cascade - whether to cascade along Valid properties
        groups - group or list of groups targeted for validation (default to Default)
        Returns:
        constraint violations or an empty Set if none
      • validateValue

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateValue​(Class<T> beanType,
                                                                                String propertyName,
                                                                                Object value,
                                                                                boolean cascade,
                                                                                Class<?>... groups)
        Description copied from interface: CascadingPropertyValidator
        Validates all constraints placed on the property named propertyName of the class beanType would the property value be value.

        ConstraintViolation objects return null for ConstraintViolation.getRootBean() and ConstraintViolation.getLeafBean().

        Specified by:
        validateValue in interface CascadingPropertyValidator
        Parameters:
        beanType - the bean type
        propertyName - property to validate
        value - property value to validate
        groups - group or list of groups targeted for validation (default to Default)
        Returns:
        constraint violations or an empty Set if none
      • forExecutables

        public jakarta.validation.executable.ExecutableValidator forExecutables()
        Specified by:
        forExecutables in interface jakarta.validation.Validator
      • validateParameters

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateParameters​(T object,
                                                                                     Method method,
                                                                                     Object[] parameterValues,
                                                                                     Class<?>... groups)
        Specified by:
        validateParameters in interface jakarta.validation.executable.ExecutableValidator
      • validateReturnValue

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateReturnValue​(T object,
                                                                                      Method method,
                                                                                      Object returnValue,
                                                                                      Class<?>... groups)
        Specified by:
        validateReturnValue in interface jakarta.validation.executable.ExecutableValidator
      • validateConstructorParameters

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateConstructorParameters​(Constructor<? extends T> constructor,
                                                                                                Object[] parameterValues,
                                                                                                Class<?>... groups)
        Specified by:
        validateConstructorParameters in interface jakarta.validation.executable.ExecutableValidator
      • validateConstructorReturnValue

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateConstructorReturnValue​(Constructor<? extends T> constructor,
                                                                                                 T createdObject,
                                                                                                 Class<?>... groups)
        Specified by:
        validateConstructorReturnValue in interface jakarta.validation.executable.ExecutableValidator
      • unwrap

        public <T> T unwrap​(Class<T> type)
        Specified by:
        unwrap in interface jakarta.validation.Validator