|
40 | 40 | import org.spdx.library.model.enumerations.ReferenceCategory; |
41 | 41 | import org.spdx.library.model.enumerations.RelationshipType; |
42 | 42 | import org.spdx.library.model.enumerations.SpdxEnumFactory; |
43 | | -import org.spdx.library.model.license.AnyLicenseInfo; |
44 | | -import org.spdx.library.model.license.ConjunctiveLicenseSet; |
| 43 | +import org.spdx.library.model.license.*; |
45 | 44 | import org.spdx.library.model.license.CrossRef.CrossRefBuilder; |
46 | | -import org.spdx.library.model.license.DisjunctiveLicenseSet; |
47 | | -import org.spdx.library.model.license.ListedLicenses; |
48 | | -import org.spdx.library.model.license.SpdxNoAssertionLicense; |
49 | | -import org.spdx.library.model.license.SpdxNoneLicense; |
50 | 45 | import org.spdx.library.model.pointer.ByteOffsetPointer; |
51 | 46 | import org.spdx.library.model.pointer.LineCharPointer; |
52 | 47 | import org.spdx.library.model.pointer.SinglePointer; |
@@ -1418,6 +1413,24 @@ public CrossRefBuilder createCrossRef(String url) throws InvalidSPDXAnalysisExce |
1418 | 1413 | return new CrossRefBuilder(this.modelStore, this.documentUri, |
1419 | 1414 | this.modelStore.getNextId(IdType.Anonymous, this.documentUri), this.copyManager, url); |
1420 | 1415 | } |
| 1416 | + |
| 1417 | + /** |
| 1418 | + * Constructs {@link ExtractedLicenseInfo} with text set. |
| 1419 | + * |
| 1420 | + * <p> Note that object construction has side-effects relating to a document and modelStore, |
| 1421 | + * requiring document context. |
| 1422 | + * This may bind usage of {@link ExtractedLicenseInfo} instances to the document that they were created by! |
| 1423 | + * |
| 1424 | + * @param id id that the text relates to |
| 1425 | + * @param text license text corresponding to the id |
| 1426 | + * @return returns a constructed object |
| 1427 | + * @throws InvalidSPDXAnalysisException |
| 1428 | + */ |
| 1429 | + public ExtractedLicenseInfo createExtractedLicense(String id, String text) throws InvalidSPDXAnalysisException { |
| 1430 | + ExtractedLicenseInfo eli = new ExtractedLicenseInfo(modelStore, documentUri, id, copyManager, true); |
| 1431 | + eli.setExtractedText(text); |
| 1432 | + return eli; |
| 1433 | + } |
1421 | 1434 |
|
1422 | 1435 | @Override |
1423 | 1436 | public String toString() { |
|
0 commit comments