Package org.spdx.library.model.v2
Class Annotation
- java.lang.Object
-
- org.spdx.core.CoreModelObject
-
- org.spdx.library.model.v2.ModelObjectV2
-
- org.spdx.library.model.v2.Annotation
-
- All Implemented Interfaces:
Comparable<Annotation>
public class Annotation extends ModelObjectV2 implements Comparable<Annotation>
An Annotation is a comment on an SpdxItem by an agent.- Author:
- Gary O'Neall
-
-
Field Summary
-
Fields inherited from class org.spdx.library.model.v2.ModelObjectV2
LATEST_SPDX_2_VERSION
-
-
Constructor Summary
Constructors Constructor Description Annotation()
Annotation(String id)
Annotation(org.spdx.storage.IModelStore modelStore, String documentUri, String id, org.spdx.core.IModelCopyManager copyManager, boolean create)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
_verify(Set<String> verifiedIds, String specVersion)
Implementation of the specific verifications for this model objectint
compareTo(Annotation o)
String
getAnnotationDate()
AnnotationType
getAnnotationType()
String
getAnnotator()
String
getComment()
String
getType()
Annotation
setAnnotationDate(String date)
Set the annotation dateAnnotation
setAnnotationType(AnnotationType type)
Annotation
setAnnotator(String annotator)
Annotation
setComment(String comment)
Set the comment-
Methods inherited from class org.spdx.library.model.v2.ModelObjectV2
_verify, createAnnotation, createByteOffsetPointer, createChecksum, createConjunctiveLicenseSet, createCreationInfo, createCrossRef, createDisjunctiveLicenseSet, createExternalDocumentRef, createExternalRef, createExtractedLicense, createLineCharPointer, createPackage, createPackageVerificationCode, createRelationship, createSpdxFile, createSpdxSnippet, createStartEndPointer, equals, getAnyLicenseInfoPropertyValue, getDocumentUri, getElementPropertyValue, getId, hashCode, isEquivalentToNull, isNoAssertion, isRelatedElement, toString, toTypedValue, verify
-
Methods inherited from class org.spdx.core.CoreModelObject
addPropertyValueToCollection, clearValueCollection, clone, copyFrom, enterCriticalSection, equivalent, equivalent, getBooleanPropertyValue, getCopyManager, getDoublePropertyValue, getEnumPropertyValue, getIdPrefix, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getObjectUri, getPropertyValueDescriptors, getSpecVersion, getStringCollection, getStringPropertyValue, isCollectionMembersAssignableTo, isExternal, isStrict, leaveCriticalSection, removeProperty, removePropertyValueFromCollection, setCopyManager, setIdPrefix, setPropertyValue, setStrict, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verifyCollection
-
-
-
-
Constructor Detail
-
Annotation
public Annotation() throws org.spdx.core.InvalidSPDXAnalysisException
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
Annotation
public Annotation(String id) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
id
- SPDX ID of the annotation- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
Annotation
public Annotation(org.spdx.storage.IModelStore modelStore, String documentUri, String id, @Nullable org.spdx.core.IModelCopyManager copyManager, boolean create) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
modelStore
- container which includes the annotationdocumentUri
- URI for the SPDX document containing the annotationid
- identifier for the licensecopyManager
- if non-null, allows for copying of any properties set which use other model stores or document URI'screate
- if true, create the license if it does not exist- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
-
Method Detail
-
getType
public String getType()
- Specified by:
getType
in classorg.spdx.core.CoreModelObject
-
getAnnotationType
public AnnotationType getAnnotationType() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- annotation type
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setAnnotationType
public Annotation setAnnotationType(AnnotationType type) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
type
-- Returns:
- this to chain setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getAnnotator
public String getAnnotator() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the annotator
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setAnnotator
public Annotation setAnnotator(String annotator) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
annotator
-- Returns:
- this to chain setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getComment
public String getComment() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the comment
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setComment
public Annotation setComment(String comment) throws org.spdx.core.InvalidSPDXAnalysisException
Set the comment- Parameters:
comment
-- Returns:
- this to chain setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getAnnotationDate
public String getAnnotationDate() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the date
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setAnnotationDate
public Annotation setAnnotationDate(String date) throws org.spdx.core.InvalidSPDXAnalysisException
Set the annotation date- Parameters:
date
-- Returns:
- this to chain setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
_verify
protected List<String> _verify(Set<String> verifiedIds, String specVersion)
Description copied from class:ModelObjectV2
Implementation of the specific verifications for this model object- Specified by:
_verify
in classModelObjectV2
- 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
public int compareTo(Annotation o)
- Specified by:
compareTo
in interfaceComparable<Annotation>
-
-