Choose validation class automatically.