def _generate_union_class_reflection_attributes(self, ns, data_type):
class_name = fmt_class(data_type.name)<EOL>for field in data_type.fields:<EOL><INDENT>field_name = fmt_var(field.name)<EOL>validator_name = generate_validator_constructor(<EOL>ns, field.data_type)<EOL>full_validator_name = '<STR_LIT>'.format(class_name, field_name)<EOL>self.emit('<STR_LIT>'.format(full_validator_name, validator_name))<EOL>if field.redactor:<EOL><INDENT>self._generate_redactor(full_validator_name, field.redactor)<EOL><DEDENT><DEDENT>child_omitted_callers = data_type.get_all_omitted_callers()<EOL>parent_omitted_callers = data_type.parent_type.get_all_omitted_callers() ifdata_type.parent_type else set([])<EOL>all_omitted_callers = child_omitted_callers | parent_omitted_callers<EOL>if len(all_omitted_callers) != <NUM_LIT:0>:<EOL><INDENT>self.emit('<STR_LIT>'.format(class_name, all_omitted_callers))<EOL><DEDENT>for omitted_caller in sorted(all_omitted_callers | {None}, key=str):<EOL><INDENT>is_public = omitted_caller is None<EOL>tagmap_name = '<STR_LIT>' if is_public else '<STR_LIT>'.format(omitted_caller)<EOL>caller_in_parent = data_type.parent_type and (is_public or omitted_caller<EOL>in parent_omitted_callers)<EOL>with self.block('<STR_LIT>'.format(class_name, tagmap_name)):<EOL><INDENT>for field in data_type.fields:<EOL><INDENT>if field.omitted_caller != omitted_caller:<EOL><INDENT>continue<EOL><DEDENT>var_name = fmt_var(field.name)<EOL>validator_name = '<STR_LIT>'.format(class_name, var_name)<EOL>self.emit("<STR_LIT>".format(var_name, validator_name))<EOL><DEDENT><DEDENT>if caller_in_parent:<EOL><INDENT>self.emit('<STR_LIT>'.format(<EOL>class_name, tagmap_name,<EOL>class_name_for_data_type(data_type.parent_type, ns))<EOL>)<EOL><DEDENT><DEDENT>self.emit()<EOL>
Adds a class attribute for each union member assigned to a validator.
Also adds an attribute that is a map from tag names to validators.