def _validate_object_can_be_tagged_with_redactor(self, annotated_object):
data_type = annotated_object.data_type<EOL>name = annotated_object.name<EOL>loc = annotated_object._ast_node.lineno, annotated_object._ast_node.path<EOL>curr_data_type = data_type<EOL>while isinstance(curr_data_type, Alias) or isinstance(curr_data_type, Nullable):<EOL><INDENT>if hasattr(curr_data_type, '<STR_LIT>') and curr_data_type.redactor:<EOL><INDENT>raise InvalidSpec("<STR_LIT>" %<EOL>(str(name), str(curr_data_type.name)), *loc)<EOL><DEDENT>curr_data_type = curr_data_type.data_type<EOL><DEDENT>if hasattr(annotated_object, '<STR_LIT>') and annotated_object.redactor:<EOL><INDENT>if is_map_type(curr_data_type) or is_list_type(curr_data_type):<EOL><INDENT>while True:<EOL><INDENT>if is_map_type(curr_data_type):<EOL><INDENT>curr_data_type = curr_data_type.value_data_type<EOL><DEDENT>else:<EOL><INDENT>curr_data_type = curr_data_type.data_type<EOL><DEDENT>should_continue = (is_map_type(curr_data_type) or is_list_type(curr_data_type)<EOL>or is_nullable_type(curr_data_type))<EOL>if should_continue is False:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>if is_user_defined_type(curr_data_type) or is_void_type(curr_data_type):<EOL><INDENT>raise InvalidSpec("<STR_LIT>", *loc)<EOL><DEDENT><DEDENT>
Validates that the object type can be annotated and object does not have
conflicting annotations.