allow adding method of document class as validator of field