Class ValidatorImpl

    • Method Detail

      • getConstraintsForClass

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

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

        public <T> Set<javax.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<javax.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 javax.validation.executable.ExecutableValidator forExecutables()
        Specified by:
        forExecutables in interface javax.validation.Validator
      • validateParameters

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

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

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

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

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