def _generate_union_class_custom_annotations(self, ns, data_type):
self.emit('<STR_LIT>')<EOL>with self.indent(), emit_pass_if_nothing_emitted(self):<EOL><INDENT>self.emit(<EOL>(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(class_name_for_data_type(data_type))<EOL>)<EOL>self.emit()<EOL>for field in data_type.fields:<EOL><INDENT>recursive_processors = list(self._generate_custom_annotation_processors(<EOL>ns, field.data_type, field.custom_annotations))<EOL>if len(recursive_processors) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>field_name = fmt_func(field.name)<EOL>self.emit('<STR_LIT>'.format(field_name))<EOL>with self.indent():<EOL><INDENT>for annotation_type, processor in recursive_processors:<EOL><INDENT>annotation_class = class_name_for_annotation_type(annotation_type, ns)<EOL>self.emit('<STR_LIT>'.format(annotation_class))<EOL>with self.indent():<EOL><INDENT>self.emit('<STR_LIT>'.format(<EOL>generate_func_call(<EOL>processor,<EOL>args=[<EOL>"<STR_LIT>".format(field_name),<EOL>'<STR_LIT>',<EOL>])<EOL>))<EOL><DEDENT>self.emit()<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
The _process_custom_annotations function allows client code to access
custom annotations defined in the spec.