[4.2] add setter and getter for Validatior

for #4037 and #4714