Package org.spdx.rdfparser.model
Class SpdxDocument
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
org.spdx.rdfparser.model.SpdxElement
org.spdx.rdfparser.model.SpdxDocument
public class SpdxDocument extends SpdxElement
An SpdxDocument is a summary of the contents, provenance, ownership and licensing
analysis of a specific software package.
This is, effectively, the top level of SPDX information.
Documents always have a model
- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.rdfparser.model.SpdxElement
annotations, comment, name, relationshipsFields inherited from class org.spdx.rdfparser.model.RdfModelObject
model, modelContainer, node, refreshOnGet, resource -
Constructor Summary
Constructors Constructor Description SpdxDocument(SpdxDocumentContainer documentContainer, org.apache.jena.graph.Node node) -
Method Summary
Modifier and Type Method Description voidaddExtractedLicenseInfos(ExtractedLicenseInfo license)booleanequivalent(IRdfModel o)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF Modelbooleanequivalent(IRdfModel o, boolean testRelationships)Test for equivalentSPDXCreatorInformationgetCreationInfo()SPDXCreatorInformationgetCreatorInfo()Deprecated.AnyLicenseInfogetDataLicense()StringgetDocumentComment()Deprecated.SpdxDocumentContainergetDocumentContainer()SpdxItem[]getDocumentDescribes()StringgetDocumentNamespace()StringgetDocumentUri()ExternalDocumentRef[]getExternalDocumentRefs()ExtractedLicenseInfo[]getExtractedLicenseInfos()protected StringgetNamePropertyName()voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesSPDXReview[]getReviewers()Deprecated.SpdxPackagegetSpdxPackage()Deprecated.StringgetSpdxVersion()Deprecated.StringgetSpecVersion()org.apache.jena.rdf.model.ResourcegetType(org.apache.jena.rdf.model.Model model)StringgetUri(IModelContainer modelContainer)Get the URI for this RDF object.voidpopulateModel()Populate the RDF model from the Java propertiesvoidsetCreationInfo(SPDXCreatorInformation creationInfo)voidsetDataLicense(AnyLicenseInfo dataLicense)voidsetExternalDocumentRefs(ExternalDocumentRef[] externalDocumentRefs)voidsetExtractedLicenseInfos(ExtractedLicenseInfo[] extractedLicenseInfos)voidsetReviewers(SPDXReview[] reviewers)Deprecated.voidsetSpecVersion(String specVersion)List<String>verify()Methods inherited from class org.spdx.rdfparser.model.SpdxElement
addAnnotation, addNameToWarnings, addRelationship, arraysEquivalent, arraysEquivalent, clone, clone, cloneAnnotations, cloneRelationships, equivalentConsideringNull, equivalentConsideringNull, getAnnotations, getComment, getId, getName, getRelationships, setAnnotations, setComment, setId, setName, setRelationships, toStringMethods inherited from class org.spdx.rdfparser.model.RdfModelObject
addPropertyUriValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, createResource, createResource, equals, findAnnotationPropertyValues, findAnyLicenseInfoPropertyValue, findAnyLicenseInfoPropertyValues, findChecksumPropertyValue, findCreationInfoPropertyValue, findDuplicateResource, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, findMultipleDoapPropertyValues, findMultipleElementPropertyValues, findMultiplePropertyValues, findReferenceTypePropertyValue, findRelationshipPropertyValues, findReviewPropertyValues, findSinglePointerPropertyValue, findSinglePropertyValue, findStartEndPointerPropertyValues, findUriPropertyValue, findUriPropertyValues, findVerificationCodePropertyValue, getNode, hashCode, isRefreshOnGet, removePropertyValue, resourcesEqual, setMultipleObjectsForSameNode, setPropertyUriValue, setPropertyUriValues, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNode
-
Constructor Details
-
SpdxDocument
public SpdxDocument(SpdxDocumentContainer documentContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException- Parameters:
documentContainer-node-- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getPropertiesFromModel
Description copied from class:RdfModelObjectFetch all of the properties from the model and populate the local Java properties- Overrides:
getPropertiesFromModelin classSpdxElement- Throws:
InvalidSPDXAnalysisException
-
getDocumentDescribes
- Returns:
- all SPDX items connected directly to this document. Does not include children SPDX items (e.g. files within packages).
- Throws:
InvalidSPDXAnalysisException
-
getUri
Description copied from class:RdfModelObjectGet the URI for this RDF object. Null if this is for an anonomous node.- Overrides:
getUriin classSpdxElement- Returns:
- Throws:
InvalidSPDXAnalysisException
-
getDocumentUri
- Returns:
- The unique Document Namespace
- Throws:
InvalidSPDXAnalysisException
-
getDocumentNamespace
- Throws:
InvalidSPDXAnalysisException
-
getType
public org.apache.jena.rdf.model.Resource getType(org.apache.jena.rdf.model.Model model)- Overrides:
getTypein classSpdxElement- Returns:
- the RDF class name for the object
-
populateModel
Description copied from class:RdfModelObjectPopulate the RDF model from the Java properties- Overrides:
populateModelin classSpdxElement- Throws:
InvalidSPDXAnalysisException
-
getDocumentContainer
- Returns:
- the documentContainer
-
getCreationInfo
- Returns:
- the creationInfo
- Throws:
InvalidSPDXAnalysisException
-
setCreationInfo
- Parameters:
creationInfo- the creationInfo to set
-
getDataLicense
- Returns:
- the dataLicense
- Throws:
InvalidSPDXAnalysisException
-
setDataLicense
- Parameters:
dataLicense- the dataLicense to set- Throws:
InvalidSPDXAnalysisException
-
getExternalDocumentRefs
- Returns:
- the externalDocumentRefs
- Throws:
InvalidSPDXAnalysisException
-
setExternalDocumentRefs
public void setExternalDocumentRefs(ExternalDocumentRef[] externalDocumentRefs) throws InvalidSPDXAnalysisException- Parameters:
externalDocumentRefs- the externalDocumentRefs to set- Throws:
InvalidSPDXAnalysisException
-
getExtractedLicenseInfos
- Returns:
- the extractedLicenseInfos
- Throws:
InvalidSPDXAnalysisException
-
setExtractedLicenseInfos
public void setExtractedLicenseInfos(ExtractedLicenseInfo[] extractedLicenseInfos) throws InvalidSPDXAnalysisException- Parameters:
extractedLicenseInfos- the extractedLicenseInfos to set- Throws:
InvalidSPDXAnalysisException
-
getSpecVersion
- Returns:
- the specVersion
-
getReviewers
Deprecated.- Returns:
- the reviewers
- Throws:
InvalidSPDXAnalysisException
-
setReviewers
Deprecated.- Parameters:
reviewers- the reviewers to set
-
setSpecVersion
- Parameters:
specVersion- the specVersion to set
-
verify
- Specified by:
verifyin interfaceIRdfModel- Overrides:
verifyin classSpdxElement- Returns:
- List of validation errors for any non SPDX compliant properties.
-
equivalent
Description copied from interface:IRdfModelReturns true if the compare object contains properties which would be equal if they were contained in the same RDF Model- Specified by:
equivalentin interfaceIRdfModel- Overrides:
equivalentin classSpdxElement- Returns:
-
equivalent
Description copied from class:SpdxElementTest for equivalent- Overrides:
equivalentin classSpdxElementtestRelationships- If true, test relationships- Returns:
-
getNamePropertyName
- Overrides:
getNamePropertyNamein classSpdxElement- Returns:
- the property name used for the Name property. Override this function if using a subproperty of SPDX Name
-
getSpdxVersion
Deprecated.This method has been replaced by getSpecVersion to match the specification property name- Returns:
-
getCreatorInfo
Deprecated.This method has been replaced by getCreationInfo to match the specification property name- Returns:
- Throws:
InvalidSPDXAnalysisException
-
getDocumentComment
Deprecated.This method has been replaced by getComment to match the specification property name- Returns:
-
getSpdxPackage
Deprecated.This method has been replaced by getSpdxItems This method will fail unless there is one and only 1 SPDX document- Returns:
- Throws:
InvalidSPDXAnalysisException
-
addExtractedLicenseInfos
public void addExtractedLicenseInfos(ExtractedLicenseInfo license) throws InvalidSPDXAnalysisException- Parameters:
license- license to be added to the extracted licensing infos- Throws:
InvalidSPDXAnalysisException
-