|
44 | 44 | * |
45 | 45 | */ |
46 | 46 | public class ExtractedLicenseInfo extends AbstractExtractedLicenseInfo { |
47 | | - |
| 47 | + |
| 48 | + /** |
| 49 | + * Create a new ExtractedLicenseInfo object |
| 50 | + * |
| 51 | + * <p> Users of the library should not call this constructor directly but use |
| 52 | + * {@link org.spdx.library.model.SpdxDocument#createExtractedLicense SpdxDocument#createExtractedLicense}. |
| 53 | + * This ensures correct behaviour between that document and its {@link ExtractedLicenseInfo} instance. |
| 54 | + * |
| 55 | + * <p> Otherwise, the object may misbehave, such as with |
| 56 | + * {@link org.spdx.library.model.SpdxDocument#addExtractedLicenseInfos SpdxDocument#addExtractedLicenseInfos}. |
| 57 | + * |
| 58 | + * @throws InvalidSPDXAnalysisException |
| 59 | + */ |
48 | 60 | public ExtractedLicenseInfo() throws InvalidSPDXAnalysisException { |
49 | 61 | super(DefaultModelStore.getDefaultModelStore().getNextId(IdType.LicenseRef, DefaultModelStore.getDefaultDocumentUri())); |
50 | 62 | } |
51 | | - |
| 63 | + |
| 64 | + /** |
| 65 | + * Create a new ExtractedLicenseInfo object |
| 66 | + * |
| 67 | + * <p> Users of the library should not call this constructor directly but use |
| 68 | + * {@link org.spdx.library.model.SpdxDocument#createExtractedLicense SpdxDocument#createExtractedLicense}. |
| 69 | + * This ensures correct behaviour between that document and its {@link ExtractedLicenseInfo} instance. |
| 70 | + * |
| 71 | + * <p> Otherwise, the object may misbehave, such as with |
| 72 | + * {@link org.spdx.library.model.SpdxDocument#addExtractedLicenseInfos SpdxDocument#addExtractedLicenseInfos}. |
| 73 | + * |
| 74 | + * @param id identifier for the license |
| 75 | + * @throws InvalidSPDXAnalysisException |
| 76 | + */ |
52 | 77 | public ExtractedLicenseInfo(String id) throws InvalidSPDXAnalysisException { |
53 | 78 | super(id); |
54 | 79 | } |
55 | 80 |
|
56 | 81 | /** |
57 | 82 | * Create a new ExtractedLicenseInfo object |
58 | | - * @param modelStore container which includes the license |
| 83 | + * |
| 84 | + * <p> Users of the library should prefer |
| 85 | + * {@link org.spdx.library.model.SpdxDocument#createExtractedLicense SpdxDocument#createExtractedLicense}. |
| 86 | + * |
| 87 | + * @param modelStore container which includes the license |
59 | 88 | * @param documentUri URI for the SPDX document containing the license |
60 | | - * @param id identifier for the license |
| 89 | + * @param id identifier for the license |
61 | 90 | * @param copyManager if non-null, allows for copying of any properties set which use other model stores or document URI's |
62 | | - * @param create if true, create the license if it does not exist |
63 | | - * @throws InvalidSPDXAnalysisException |
| 91 | + * @param create if true, create the license if it does not exist |
| 92 | + * @throws InvalidSPDXAnalysisException |
64 | 93 | */ |
65 | 94 | public ExtractedLicenseInfo(IModelStore modelStore, String documentUri, String id, |
66 | 95 | @Nullable ModelCopyManager copyManager, boolean create) |
67 | 96 | throws InvalidSPDXAnalysisException { |
68 | 97 | super(modelStore, documentUri, id, copyManager, create); |
69 | 98 | } |
70 | | - |
| 99 | + |
71 | 100 | /** |
72 | 101 | * Create a new ExtractedLicenseInfo using the ID and text |
73 | | - * @param id |
74 | | - * @param text |
75 | | - * @throws InvalidSPDXAnalysisException |
| 102 | + * |
| 103 | + * <p> Users of the library should not call this constructor directly but use |
| 104 | + * {@link org.spdx.library.model.SpdxDocument#createExtractedLicense SpdxDocument#createExtractedLicense}. |
| 105 | + * This ensures correct behaviour between that document and its {@link ExtractedLicenseInfo} instance. |
| 106 | + * |
| 107 | + * <p> Otherwise, the object may misbehave, such as with |
| 108 | + * {@link org.spdx.library.model.SpdxDocument#addExtractedLicenseInfos SpdxDocument#addExtractedLicenseInfos}. |
| 109 | + * |
| 110 | + * @param id identifier for the license |
| 111 | + * @param text text to associate with the license |
| 112 | + * @throws InvalidSPDXAnalysisException |
76 | 113 | */ |
77 | 114 | public ExtractedLicenseInfo(String id, String text) throws InvalidSPDXAnalysisException { |
78 | 115 | super(id); |
@@ -101,7 +138,9 @@ public String getExtractedText() throws InvalidSPDXAnalysisException { |
101 | 138 | } |
102 | 139 |
|
103 | 140 | /** |
104 | | - * @param text the text to set |
| 141 | + * Sets the license text. |
| 142 | + * <p> Affects both this object and the underlying store. |
| 143 | + * @param text text to associate with the license |
105 | 144 | * @throws InvalidSPDXAnalysisException |
106 | 145 | */ |
107 | 146 | public void setExtractedText(String text) throws InvalidSPDXAnalysisException { |
|
0 commit comments