You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `newDefaultDocumentUri` is a default document URI used for SPDX Spec version 2 model objects.
33
+
34
+
IMPORTANT NOTE: The call to `DefaultModelStore.initialize` must be made prior to or immediately after the call
35
+
to `SpdxModelFactory.init()`. Otherwise, any data stored in the previous default model object will be lost.
36
+
The `SpdxModelFactory.init()` will not overwrite an already initialized default model store.
37
+
38
+
## SPDX Spec Version 3
39
+
40
+
### Programmatically Creating SPDX Data
41
+
22
42
All SPDX elements are required to have a unique SPDX ID which is an Object URI. In the SPDX Java libraries, this is commonly referred to as the `objectUri` to avoid confusion with the SPDX 2.X version short SPDX IDs.
23
43
24
44
A good practice is to create a common prefix to use for your programmatic session. The prefix should be unique to the session. There are convenience methods in the library to append identifiers unique to the model store.
Since SPDX 3.0 requires creation info on every element, the easiest way to start is to use the SPDX 3 model convenience method `SpdxModelClassFactory.createCreationInfo(...)` which will create the `Agent` and `CreationInfo` classes which can be added to all of the subsequent elements.
52
+
Since SPDX 3.0 requires creation info on every element, the easiest way to start is to use the SPDX 3 model convenience method `SpdxModelClassFactory.createCreationInfo(...)` which will create the `Agent` and `CreationInfo` classes which can be added to all the subsequent elements.
33
53
34
54
For example:
35
55
@@ -68,3 +88,56 @@ sbom.getElements().add(
68
88
```
69
89
70
90
The model store, creation info, copy manager, and prefix information will all be copied from the sbom allowing you to focus just on the properties you need to add.
91
+
92
+
## SPDX Spec Version 2
93
+
94
+
### Programmatically Creating SPDX Data
95
+
96
+
SPDX Spec version 2 stores all date within an SPDX document. SPDX documents have a single document URI which is a
0 commit comments