Package org.spdx.library.model
Class SpdxConstantElement
java.lang.Object
org.spdx.library.model.ModelObject
org.spdx.library.model.SpdxElement
org.spdx.library.model.SpdxConstantElement
- All Implemented Interfaces:
IndividualUriValue
- Direct Known Subclasses:
SpdxNoAssertionElement,SpdxNoneElement
public abstract class SpdxConstantElement extends SpdxElement implements IndividualUriValue
Type of SpdxElement which is a constant unmodifiable element
- Author:
- Gary O'Neall
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SpdxConstantElement(String id)SpdxConstantElement(IModelStore modelStore, String documentUri, String id) -
Method Summary
Modifier and Type Method Description protected List<String>_verify(Set<String> verifiedIds, String specVersion)Implementation of the specific verifications for this model objectbooleanaddAnnotation(Annotation annotation)Add an annotationbooleanaddRelationship(Relationship relationship)Add a relationshipbooleanequals(Object comp)Collection<Annotation>getAnnotations()Collection<Relationship>getRelationships()StringgetType()inthashCode()booleanremoveAnnotation(Annotation annotation)Remove an annotationbooleanremoveRelationship(Relationship relationship)Remove a relationshipSpdxElementsetAnnotations(Collection<Annotation> annotations)Clears and resets the annotations collection to the parametervoidsetComment(String comment)Sets the commentSpdxElementsetName(String name)Set the nameSpdxElementsetRelationships(Collection<Relationship> relationships)clear and reset the relationships to the paramater relationshipMethods inherited from class org.spdx.library.model.SpdxElement
addNameToWarnings, getComment, getName, getNamePropertyNameMethods 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, equivalent, equivalent, getAnyLicenseInfoPropertyValue, getBooleanPropertyValue, getCopyManager, getDocumentUri, getElementPropertyValue, getEnumPropertyValue, getId, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getPropertyValueNames, getStringCollection, getStringPropertyValue, 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
-
SpdxConstantElement
- Throws:
InvalidSPDXAnalysisException
-
SpdxConstantElement
public SpdxConstantElement(IModelStore modelStore, String documentUri, String id) throws InvalidSPDXAnalysisException- Parameters:
modelStore- where the model is storeddocumentUri- Unique document URIid- ID for the constant element- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
_verify
Description copied from class:ModelObjectImplementation of the specific verifications for this model object- Overrides:
_verifyin classSpdxElement- 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
-
getType
- Specified by:
getTypein classModelObject- Returns:
- The class name for this object. Class names are defined in the constants file
-
getAnnotations
- Overrides:
getAnnotationsin classSpdxElement- Returns:
- Annotations
- Throws:
InvalidSPDXAnalysisException
-
setAnnotations
public SpdxElement setAnnotations(Collection<Annotation> annotations) throws InvalidSPDXAnalysisExceptionDescription copied from class:SpdxElementClears and resets the annotations collection to the parameter- Overrides:
setAnnotationsin classSpdxElement- Returns:
- this to chain setters
- Throws:
InvalidSPDXAnalysisException
-
addAnnotation
Description copied from class:SpdxElementAdd an annotation- Overrides:
addAnnotationin classSpdxElement- Returns:
- Throws:
InvalidSPDXAnalysisException
-
removeAnnotation
Description copied from class:SpdxElementRemove an annotation- Overrides:
removeAnnotationin classSpdxElement- Returns:
- Throws:
InvalidSPDXAnalysisException
-
getRelationships
- Overrides:
getRelationshipsin classSpdxElement- Returns:
- Relationships
- Throws:
InvalidSPDXAnalysisException
-
setRelationships
public SpdxElement setRelationships(Collection<Relationship> relationships) throws InvalidSPDXAnalysisExceptionDescription copied from class:SpdxElementclear and reset the relationships to the paramater relationship- Overrides:
setRelationshipsin classSpdxElement- Returns:
- this to chain sets
- Throws:
InvalidSPDXAnalysisException
-
addRelationship
Description copied from class:SpdxElementAdd a relationship- Overrides:
addRelationshipin classSpdxElement- Returns:
- Throws:
InvalidSPDXAnalysisException
-
removeRelationship
Description copied from class:SpdxElementRemove a relationship- Overrides:
removeRelationshipin classSpdxElement- Returns:
- Throws:
InvalidSPDXAnalysisException
-
setComment
Description copied from class:SpdxElementSets the comment- Overrides:
setCommentin classSpdxElement- Throws:
InvalidSPDXAnalysisException
-
setName
Description copied from class:SpdxElementSet the name- Overrides:
setNamein classSpdxElement- Returns:
- this so that you can chain setters
- Throws:
InvalidSPDXAnalysisException
-
equals
- Overrides:
equalsin classModelObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classModelObject
-