def _generate_validator(self, field):
validator = self._determine_validator_type(field.data_type,<EOL>fmt_var(field.name),<EOL>field.has_default)<EOL>value = fmt_var(<EOL>field.name) if not field.has_default else '<STR_LIT>'.format(<EOL>fmt_var(field.name), fmt_default_value(field))<EOL>if validator:<EOL><INDENT>self.emit('<STR_LIT>'.format(validator, value))<EOL><DEDENT>
Emits validator if data type has associated validator.