Package org.spdx.library.model
Class Annotation
java.lang.Object
org.spdx.library.model.ModelObject
org.spdx.library.model.Annotation
- All Implemented Interfaces:
Comparable<Annotation>
public class Annotation extends ModelObject implements Comparable<Annotation>
An Annotation is a comment on an SpdxItem by an agent.
- Author:
- Gary O'Neall
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Annotation()Annotation(String id)Annotation(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) -
Method Summary
Modifier and Type Method Description List<String>_verify(Set<String> verifiedIds, String specVersion)Implementation of the specific verifications for this model objectintcompareTo(Annotation o)StringgetAnnotationDate()AnnotationTypegetAnnotationType()StringgetAnnotator()StringgetComment()StringgetType()AnnotationsetAnnotationDate(String date)Set the annotation dateAnnotationsetAnnotationType(AnnotationType type)AnnotationsetAnnotator(String annotator)AnnotationsetComment(String comment)Set the commentMethods inherited from class org.spdx.library.model.ModelObject
addPropertyValueToCollection, addValueToCollection, clearValueCollection, clearValueCollection, clone, copyFrom, createAnnotation, createByteOffsetPointer, createChecksum, createConjunctiveLicenseSet, createCreationInfo, createCrossRef, createDisjunctiveLicenseSet, createExternalDocumentRef, createExternalRef, createLineCharPointer, createPackage, createPackageVerificationCode, createRelationship, createSpdxFile, createSpdxSnippet, createStartEndPointer, enterCriticalSection, equals, equivalent, equivalent, getAnyLicenseInfoPropertyValue, getBooleanPropertyValue, getCopyManager, getDocumentUri, getElementPropertyValue, getEnumPropertyValue, getId, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getPropertyValueNames, getStringCollection, getStringPropertyValue, hashCode, idToIdType, isCollectionMembersAssignableTo, isStrict, leaveCriticalSection, removeProperty, removeProperty, removePropertyValueFromCollection, removePropertyValueFromCollection, replacePropertyValueCollection, setCopyManager, setPropertyValue, setPropertyValue, setStrict, toString, toTypedValue, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verify, verifyCollection
-
Constructor Details
-
Annotation
- Throws:
InvalidSPDXAnalysisException
-
Annotation
- Parameters:
id-- Throws:
InvalidSPDXAnalysisException
-
Annotation
public Annotation(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException- Parameters:
modelStore-documentUri-id-copyManager-create-- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getType
- Specified by:
getTypein classModelObject- Returns:
- The class name for this object. Class names are defined in the constants file
-
getAnnotationType
- Returns:
- annotation type
- Throws:
InvalidSPDXAnalysisException
-
setAnnotationType
- Parameters:
type-- Returns:
- this to chain setters
- Throws:
InvalidSPDXAnalysisException
-
getAnnotator
- Returns:
- the annotator
- Throws:
InvalidSPDXAnalysisException
-
setAnnotator
- Parameters:
annotator-- Returns:
- this to chain setters
- Throws:
InvalidSPDXAnalysisException
-
getComment
- Returns:
- the comment
- Throws:
InvalidSPDXAnalysisException
-
setComment
Set the comment- Parameters:
comment-- Returns:
- this to chain setters
- Throws:
InvalidSPDXAnalysisException
-
getAnnotationDate
- Returns:
- the date
- Throws:
InvalidSPDXAnalysisException
-
setAnnotationDate
Set the annotation date- Parameters:
date-- Returns:
- this to chain setters
- Throws:
InvalidSPDXAnalysisException
-
_verify
Description copied from class:ModelObjectImplementation of the specific verifications for this model object- Specified by:
_verifyin classModelObject- Parameters:
verifiedIds- list of all Element Id's which have already been verified - prevents infinite recursionspecVersion- Version of the SPDX spec to verify against- Returns:
- Any verification errors or warnings associated with this object
-
compareTo
- Specified by:
compareToin interfaceComparable<Annotation>
-