Package org.spdx.library.model.v2
Class SpdxConstantElement
- java.lang.Object
-
- org.spdx.core.CoreModelObject
-
- org.spdx.library.model.v2.ModelObjectV2
-
- org.spdx.library.model.v2.SpdxElement
-
- org.spdx.library.model.v2.SpdxConstantElement
-
- All Implemented Interfaces:
org.spdx.core.IndividualUriValue
- Direct Known Subclasses:
SpdxNoAssertionElement
,SpdxNoneElement
public abstract class SpdxConstantElement extends SpdxElement implements org.spdx.core.IndividualUriValue
Type of SpdxElement which is a constant unmodifiable element- 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 SpdxConstantElement(String id)
SpdxConstantElement(org.spdx.storage.IModelStore modelStore, String documentUri, String id)
-
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 objectboolean
addAnnotation(Annotation annotation)
Add an annotationboolean
addRelationship(Relationship relationship)
Add a relationshipboolean
equals(Object comp)
Collection<Annotation>
getAnnotations()
Collection<Relationship>
getRelationships()
String
getType()
int
hashCode()
boolean
isExternal()
boolean
removeAnnotation(Annotation annotation)
Remove an annotationboolean
removeRelationship(Relationship relationship)
Remove a relationshipSpdxElement
setAnnotations(Collection<Annotation> annotations)
Clears and resets the annotations collection to the parametervoid
setComment(String comment)
Sets the commentSpdxElement
setName(String name)
Set the nameSpdxElement
setRelationships(Collection<Relationship> relationships)
clear and reset the relationships to the parameter relationship-
Methods inherited from class org.spdx.library.model.v2.SpdxElement
addNameToWarnings, getComment, getName, getNamePropertyDescriptor
-
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, getAnyLicenseInfoPropertyValue, getDocumentUri, getElementPropertyValue, getId, 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, isStrict, leaveCriticalSection, removeProperty, removePropertyValueFromCollection, setCopyManager, setIdPrefix, setPropertyValue, setStrict, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verifyCollection
-
-
-
-
Constructor Detail
-
SpdxConstantElement
public SpdxConstantElement(String id) throws org.spdx.core.InvalidSPDXAnalysisException
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
SpdxConstantElement
public SpdxConstantElement(org.spdx.storage.IModelStore modelStore, String documentUri, String id) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
modelStore
- where the model is storeddocumentUri
- Unique document URIid
- ID for the constant element- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
-
Method Detail
-
isExternal
public boolean isExternal()
- Overrides:
isExternal
in classorg.spdx.core.CoreModelObject
-
_verify
protected List<String> _verify(Set<String> verifiedIds, String specVersion)
Description copied from class:ModelObjectV2
Implementation of the specific verifications for this model object- Overrides:
_verify
in 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
public String getType()
- Specified by:
getType
in classorg.spdx.core.CoreModelObject
-
getAnnotations
public Collection<Annotation> getAnnotations() throws org.spdx.core.InvalidSPDXAnalysisException
- Overrides:
getAnnotations
in classSpdxElement
- Returns:
- Annotations
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setAnnotations
public SpdxElement setAnnotations(Collection<Annotation> annotations) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Clears and resets the annotations collection to the parameter- Overrides:
setAnnotations
in classSpdxElement
- Returns:
- this to chain setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
addAnnotation
public boolean addAnnotation(Annotation annotation) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Add an annotation- Overrides:
addAnnotation
in classSpdxElement
- Returns:
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
removeAnnotation
public boolean removeAnnotation(Annotation annotation) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Remove an annotation- Overrides:
removeAnnotation
in classSpdxElement
- Returns:
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getRelationships
public Collection<Relationship> getRelationships() throws org.spdx.core.InvalidSPDXAnalysisException
- Overrides:
getRelationships
in classSpdxElement
- Returns:
- Relationships
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setRelationships
public SpdxElement setRelationships(Collection<Relationship> relationships) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
clear and reset the relationships to the parameter relationship- Overrides:
setRelationships
in classSpdxElement
- Returns:
- this to chain sets
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
addRelationship
public boolean addRelationship(Relationship relationship) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Add a relationship- Overrides:
addRelationship
in classSpdxElement
- Returns:
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
removeRelationship
public boolean removeRelationship(Relationship relationship) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Remove a relationship- Overrides:
removeRelationship
in classSpdxElement
- Returns:
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setComment
public void setComment(String comment) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Sets the comment- Overrides:
setComment
in classSpdxElement
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setName
public SpdxElement setName(String name) throws org.spdx.core.InvalidSPDXAnalysisException
Description copied from class:SpdxElement
Set the name- Overrides:
setName
in classSpdxElement
- Returns:
- this so that you can chain setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
equals
public boolean equals(Object comp)
- Overrides:
equals
in classModelObjectV2
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classModelObjectV2
-
-