def add_annotation_type(self, doc, annotation_type):
if len(doc.annotations) != <NUM_LIT:0>:<EOL><INDENT>if not self.annotation_type_set:<EOL><INDENT>self.annotation_type_set = True<EOL>if validations.validate_annotation_type(annotation_type):<EOL><INDENT>doc.annotations[-<NUM_LIT:1>].annotation_type = annotation_type<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise SPDXValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise OrderError('<STR_LIT>')<EOL><DEDENT>
Sets the annotation type. Raises CardinalityError if
        already set. OrderError if no annotator defined before.
        Raises SPDXValueError if invalid value.