Package org.spdx.core
Interface IModelCopyManager
-
public interface IModelCopyManager
Implementation classes of this interface helps facilitate copying objects from one model to another.In addition to the copy functions (methods), these objects keeps track of what was copied where so that the same object is not copied twice.
These objects can be passed into the constructor for ModelObjects to allow the objects to be copied.
- Author:
- Gary O'Neall
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
copy(IModelStore toStore, String toObjectUri, IModelStore fromStore, String fromObjectUri, String toSpecVersion, String toNamespace)
Copy an item from one Model Object Store to anotherTypedValue
copy(IModelStore toStore, IModelStore fromStore, String sourceUri, String toSpecVersion, String toNamespace)
Copy an item from one Model Object Store to another using the source ID for the target unless it is anonymousString
getCopiedObjectUri(IModelStore fromStore, String fromObjectUri, IModelStore toStore)
String
putCopiedId(IModelStore fromStore, String fromObjectUri, IModelStore toStore, String toObjectUri)
Record a copied ID between model stores
-
-
-
Method Detail
-
copy
TypedValue copy(IModelStore toStore, IModelStore fromStore, String sourceUri, String toSpecVersion, @Nullable String toNamespace) throws InvalidSPDXAnalysisException
Copy an item from one Model Object Store to another using the source ID for the target unless it is anonymous- Parameters:
toStore
- Model Store to copy tofromStore
- Model Store containing the source itemsourceUri
- URI for the Source objecttoSpecVersion
- version of the spec the to value should comply withtoNamespace
- optional namespace of the to property- Returns:
- Object URI for the copied object
- Throws:
InvalidSPDXAnalysisException
- on any SPDX related error
-
copy
void copy(IModelStore toStore, String toObjectUri, IModelStore fromStore, String fromObjectUri, String toSpecVersion, @Nullable String toNamespace) throws InvalidSPDXAnalysisException
Copy an item from one Model Object Store to another- Parameters:
toStore
- Model Store to copy totoObjectUri
- URI for the destination objectfromStore
- Model Store containing the source itemfromObjectUri
- Object URI for the source itemtoSpecVersion
- version of the spec the to value should comply withtoNamespace
- optional namespace of the to property- Throws:
InvalidSPDXAnalysisException
- on any SPDX related error
-
getCopiedObjectUri
String getCopiedObjectUri(IModelStore fromStore, String fromObjectUri, IModelStore toStore)
- Parameters:
fromStore
- Store copied fromfromObjectUri
- Object URI in the from tsotretoStore
- store copied to- Returns:
- the objectId which has already been copied, or null if it has not been copied
-
putCopiedId
String putCopiedId(IModelStore fromStore, String fromObjectUri, IModelStore toStore, String toObjectUri)
Record a copied ID between model stores- Parameters:
fromStore
- Store copied fromfromObjectUri
- URI for the from ObjecttoObjectUri
- URI for the to Object- Returns:
- any copied to ID for the same stores, URI's, nameSpace and fromID
-
-