From 7e75eb6f35aa873701082951eaad52e28e37231c Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Sun, 26 Jan 2025 10:39:25 +0000 Subject: [PATCH 1/4] Fix bullets in CoreModelObject Javadoc Add + *

* This class also handles the conversion of a CoreModelObject to and from a TypeValue for storage in the ModelStore. * * @author Gary O'Neall diff --git a/src/main/java/org/spdx/core/TypedValue.java b/src/main/java/org/spdx/core/TypedValue.java index 82da58a..4851e11 100644 --- a/src/main/java/org/spdx/core/TypedValue.java +++ b/src/main/java/org/spdx/core/TypedValue.java @@ -11,6 +11,8 @@ public class TypedValue { String specVersion; /** + * Constructs a TypedValue with the specified object URI, type, and spec version. + * * @param objectUri URI or anon ID for the object * @param type a string representation of the type of the object * @param specVersion version of the spec From 9ccdd5b880f4fac8b74e8416a49dc268d8834611 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Sun, 26 Jan 2025 11:00:38 +0000 Subject: [PATCH 3/4] Add Javadoc for SpdxCoreConstants Enums Signed-off-by: Arthit Suriyawongkul --- .../java/org/spdx/core/SpdxCoreConstants.java | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/spdx/core/SpdxCoreConstants.java b/src/main/java/org/spdx/core/SpdxCoreConstants.java index 850b318..c2e63b5 100644 --- a/src/main/java/org/spdx/core/SpdxCoreConstants.java +++ b/src/main/java/org/spdx/core/SpdxCoreConstants.java @@ -11,14 +11,33 @@ */ public class SpdxCoreConstants { + /** + * Enumeration representing the major versions of the SPDX specification + */ @SuppressWarnings("unused") public enum SpdxMajorVersion { + /** + * SPDX version 1.x + */ VERSION_1("SPDX-1."), + + /** + * SPDX version 2.x + */ VERSION_2("SPDX-2."), + + /** + * SPDX version 3.x + */ VERSION_3("3."); private final String prefix; - + + /** + * Returns the latest major version of the SPDX specification. + * + * @return the latest major version + */ public static SpdxMajorVersion latestVersion() { return VERSION_3; } @@ -35,10 +54,17 @@ String prefix() { } } - // SPDX Listed License constants + /** + * The URL for the SPDX Listed Licenses. + */ public static final String LISTED_LICENSE_URL = "https://spdx.org/licenses/"; - // http rather than https since RDF depends on the exact string, - // we were not able to update the namespace variable to match the URL's. + + /** + * The namespace prefix for the SPDX Listed Licenses. + *

+ * Note: This uses "http" rather than "https" since RDF depends on the exact string, + * and we were not able to update the namespace variable to match the URL's. + */ public static final String LISTED_LICENSE_NAMESPACE_PREFIX = "http://spdx.org/licenses/"; } From 7d7de4573538d94a21d3f32e4e666556ef614653 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Sun, 26 Jan 2025 13:13:34 +0000 Subject: [PATCH 4/4] Remove extra "-" at the beginning of the param description Signed-off-by: Arthit Suriyawongkul --- src/main/java/org/spdx/core/CoreModelObject.java | 4 ++-- src/main/java/org/spdx/core/ModelObjectHelper.java | 6 +++--- src/main/java/org/spdx/core/ModelSet.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/spdx/core/CoreModelObject.java b/src/main/java/org/spdx/core/CoreModelObject.java index 00fa4c7..3d16da0 100644 --- a/src/main/java/org/spdx/core/CoreModelObject.java +++ b/src/main/java/org/spdx/core/CoreModelObject.java @@ -102,7 +102,7 @@ public abstract class CoreModelObject { /** * Create a new Model Object using an Anonymous ID with the default store and default document URI - * @param specVersion - version of the SPDX spec the object complies with + * @param specVersion version of the SPDX spec the object complies with * @throws InvalidSPDXAnalysisException on any SPDX related exception */ protected CoreModelObject(String specVersion) throws InvalidSPDXAnalysisException { @@ -185,7 +185,7 @@ public boolean isExternal() { /** * @param builder base builder to create the CoreModelObject from - * @param specVersion - version of the SPDX spec the object complies with + * @param specVersion version of the SPDX spec the object complies with * @throws InvalidSPDXAnalysisException on any SPDX related exception */ protected CoreModelObject(CoreModelObjectBuilder builder, String specVersion) throws InvalidSPDXAnalysisException { diff --git a/src/main/java/org/spdx/core/ModelObjectHelper.java b/src/main/java/org/spdx/core/ModelObjectHelper.java index 7738511..4707ad6 100644 --- a/src/main/java/org/spdx/core/ModelObjectHelper.java +++ b/src/main/java/org/spdx/core/ModelObjectHelper.java @@ -48,7 +48,7 @@ private ModelObjectHelper() { * @param objectUri the Object URI or anonymous ID * @param propertyDescriptor property descriptor for the property * @param copyManager if non null, any ModelObject property value not stored in the modelStore under the stDocumentUri will be copied to make it available - * @param specVersion - version of the SPDX spec the object complies with + * @param specVersion version of the SPDX spec the object complies with * @param type optional type hint - used for individuals where the type may be ambiguous * @param idPrefix prefix to be used when generating new SPDX IDs * @return value associated with a property @@ -184,7 +184,7 @@ public static void removePropertyValueFromCollection(IModelStore modelStore, Str * @param modelStore ModelStore to use in fetching or creating * @param copyManager if not null, copy any referenced ID's outside of this * document/model store - * @param specVersion - version of the SPDX spec the object complies with + * @param specVersion version of the SPDX spec the object complies with * @param type optional type hint - used for individuals where the type may be ambiguous * @param idPrefix Prefix to be used if any new object URI's are generated * @return the object itself unless it is a TypedValue, in which case a @@ -250,7 +250,7 @@ public static Object modelObjectToStoredObject(Object value, IModelStore modelSt * @param modelStore ModelStore to use in fetching or creating * @param copyManager if not null, copy any referenced ID's outside of this * document/model store - * @param specVersion - version of the SPDX spec the object complies with + * @param specVersion version of the SPDX spec the object complies with * @param type optional type hint - used for individuals where the type may be ambiguous * @param idPrefix Prefix to be used if any new object URI's are generated * @return the object itself unless it is a TypedValue, in which case a diff --git a/src/main/java/org/spdx/core/ModelSet.java b/src/main/java/org/spdx/core/ModelSet.java index 711db09..83bfbd0 100644 --- a/src/main/java/org/spdx/core/ModelSet.java +++ b/src/main/java/org/spdx/core/ModelSet.java @@ -47,7 +47,7 @@ public class ModelSet extends ModelCollection implemen * @param propertyDescriptor descriptor for the property use for the model collections * @param copyManager if non-null, use this to copy properties when referenced outside this model store * @param type The class of the elements to be stored in the collection if none, null if not known - * @param specVersion - version of the SPDX spec the object complies with + * @param specVersion version of the SPDX spec the object complies with * @param idPrefix prefix to be used when generating new SPDX IDs * @throws InvalidSPDXAnalysisException on parsing or store errors */