def set_annotation_spdx_id(self, doc, spdx_id):
if len(doc.annotations) != <NUM_LIT:0>:<EOL><INDENT>if not self.annotation_spdx_id_set:<EOL><INDENT>self.annotation_spdx_id_set = True<EOL>doc.annotations[-<NUM_LIT:1>].spdx_id = spdx_id<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise OrderError('<STR_LIT>')<EOL><DEDENT>
Sets the annotation SPDX Identifier.
        Raises CardinalityError if already set. OrderError if no annotator
        defined before.