@@ -120,12 +120,10 @@ public static void init() {
120120 * If the object does not exist AND the create parameter is true, a new object will be created and
121121 * its inflated form will be returned
122122 * @param modelStore store to use for the inflated object
123- * @param objectUri URI of the external element
124- * @param documentUri URI for the SPDX document to store the external element reference - used for compatibility with SPDX 2.X model stores
123+ * @param objectUri URI of the element or SPDX object
125124 * @param type Type of the object to create
126125 * @param copyManager if non-null, implicitly copy any referenced properties from other model stores
127- * @param externalMap map of URI's to ExternalMaps for any external elements
128- * @param specVersion version of the SPDX spec the object complies with
126+ *@param specVersion version of the SPDX spec the object complies with
129127 * @param create if true, create the model object ONLY if it does not already exist
130128 * @param idPrefix optional prefix used for any new object URI's created in support of this model object
131129 * @return model object of type type
@@ -145,10 +143,8 @@ public static CoreModelObject inflateModelObject(IModelStore modelStore, String
145143 * its inflated form will be returned
146144 * @param modelStore store to use for the inflated object
147145 * @param objectUri URI of the external element
148- * @param documentUri URI for the SPDX document to store the external element reference - used for compatibility with SPDX 2.X model stores
149146 * @param type Type of the object to create
150147 * @param copyManager if non-null, implicitly copy any referenced properties from other model stores
151- * @param externalMap map of URI's to ExternalMaps for any external elements
152148 * @param create if true, create the model object ONLY if it does not already exist
153149 * @param idPrefix optional prefix used for any new object URI's created in support of this model object
154150 * @return model object of type type
@@ -163,30 +159,28 @@ public static CoreModelObject inflateModelObject(IModelStore modelStore, String
163159 * @param store store to use for the inflated object
164160 * @param uri URI of the external element
165161 * @param copyManager if non-null, implicitly copy any referenced properties from other model stores
166- * @param documentUri URI for the SPDX document to store the external element reference - used for compatibility with SPDX 2.X model stores
167- * @param externalMap Map of URI's of elements referenced but not present in the store
162+ * @param type type hint for creating the correct external element
168163 * @param specVersion version of the SPDX spec the object complies with
169164 * @return a java object representing an SPDX element external to model store, collection or document
170165 * @throws InvalidSPDXAnalysisException
171166 */
172167 public static Object getExternalElement (IModelStore store , String uri ,
173- @ Nullable IModelCopyManager copyManager ,
168+ @ Nullable IModelCopyManager copyManager , Class <?> type ,
174169 String specVersion ) throws InvalidSPDXAnalysisException {
175- return ModelRegistry .getModelRegistry ().getExternalElement (store , uri , copyManager , specVersion );
170+ return ModelRegistry .getModelRegistry ().getExternalElement (store , uri , copyManager , type , specVersion );
176171 }
177172
178173 /**
179174 * @param store store to use for the inflated object
180175 * @param uri URI of the external element
181176 * @param copyManager if non-null, implicitly copy any referenced properties from other model stores
182- * @param documentUri URI for the SPDX document to store the external element reference - used for compatibility with SPDX 2.X model stores
183- * @param externalMap Map of URI's of elements referenced but not present in the store
177+ * @param type type hint for creating the correct external element
184178 * @return a java object representing an SPDX element external to model store, collection or document for the most recent version of the spec supported
185179 * @throws InvalidSPDXAnalysisException
186180 */
187181 public static Object getExternalElement (IModelStore store , String uri ,
188- @ Nullable IModelCopyManager copyManager ) throws InvalidSPDXAnalysisException {
189- return getExternalElement (store , uri , copyManager , getLatestSpecVersion ());
182+ @ Nullable IModelCopyManager copyManager , Class <?> type ) throws InvalidSPDXAnalysisException {
183+ return getExternalElement (store , uri , copyManager , type , getLatestSpecVersion ());
190184 }
191185
192186 /**
0 commit comments