[4.2] add setter and getter for Validatior

for #4037 and #4714
There's already a `setAttributeNames` method that does almost the same