Skip to content

Commit a7fe5be

Browse files
authored
Merge pull request #172 from spdx/issue171
Check for ReferenceType in simpleUri toObjectValue
2 parents f2086d2 + a313e4c commit a7fe5be

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/spdx/library/SpdxConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public class SpdxConstants {
228228
public static final String PROP_BUILT_DATE = "builtDate";
229229
public static final String PROP_RELEASE_DATE = "releaseDate";
230230
public static final String PROP_VALID_UNTIL_DATE = "validUntilDate";
231+
public static final Pattern REFERENCE_TYPE_URI_PATTERN = Pattern.compile("https?://spdx.org/rdf/references/.+");
231232

232233
// SPDX License Properties
233234
// The comment property is the RDFS_PROP_COMMENT property in the rdfs namespace

src/main/java/org/spdx/library/model/SimpleUriValue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public Object toModelObject(IModelStore store, String documentUri, ModelCopyMana
100100
return ExternalSpdxElement.uriToExternalSpdxElement(uri, store, documentUri, copyManager);
101101
} else if (SpdxConstants.EXTERNAL_EXTRACTED_LICENSE_URI_PATTERN.matcher(uri).matches()) {
102102
return ExternalExtractedLicenseInfo.uriToExternalExtractedLicense(uri, store, documentUri, copyManager);
103+
} else if (SpdxConstants.REFERENCE_TYPE_URI_PATTERN.matcher(uri).matches()) {
104+
return new ReferenceType(this);
103105
} else if (SpdxConstants.URI_VALUE_NONE.equals(uri)) {
104106
// Default value is a license, although it can also be a string or an SpdxElement
105107
// the caller should override the type based on the type expected

0 commit comments

Comments
 (0)