public boolean apply ( final Class < ? > type , final Object value , final List < ValidationFailure > validationFailures ) { if ( getRequiredValueType ( ) . isAssignableFrom ( value . getClass ( ) ) ) { validate ( type , value , validationFailures ) ; return true ; } return false ; }
Applied validation for the given field . If the value does not match the correct type the validation is not applied and this method returns false . If the value is to be validated then the validate method is called to see if the value and type are compatible . Errors are appended to the validationFailures list .