Skip to content

Commit e6ffecf

Browse files
bactgoneall
authored andcommitted
Add javadoc for SpdxToolsHelper
Signed-off-by: Arthit Suriyawongkul <[email protected]>
1 parent 4633af2 commit e6ffecf

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

src/main/java/org/spdx/tools/SpdxToolsHelper.java

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
*/
5959
public class SpdxToolsHelper {
6060

61+
/**
62+
* Supported serialization file types
63+
*/
6164
public enum SerFileType {
6265
JSON, RDFXML, XML, XLS, XLSX, YAML, TAG, RDFTTL, JSONLD
6366
}
@@ -84,6 +87,9 @@ public enum SerFileType {
8487
}
8588

8689
/**
90+
* Determine the appropriate in memory based model store which supports
91+
* serialization for the fileType
92+
*
8793
* @param fileType
8894
* file type for the store
8995
* @return the appropriate in memory based model store which supports
@@ -129,6 +135,8 @@ public static ISerializableModelStore fileTypeToStore(SerFileType fileType)
129135
}
130136

131137
/**
138+
* Determine the file type based on the file name and extension
139+
*
132140
* @param file
133141
* @return the file type based on the file name and file extension
134142
* @throws InvalidFileNameException
@@ -188,6 +196,8 @@ public static SerFileType fileToFileType(File file)
188196
}
189197

190198
/**
199+
* Determine the file type based on the file extension or string
200+
*
191201
* @param str
192202
* @return the file type based on the file extension or string
193203
*/
@@ -197,6 +207,9 @@ public static SerFileType strToFileType(String str) {
197207
}
198208

199209
/**
210+
* Deserializes an SPDX document from a file,
211+
* compatible with SPDX version 2
212+
*
200213
* @param file
201214
* file containing an SPDX document with the standard file
202215
* extension for the serialization formats
@@ -215,6 +228,9 @@ public static SpdxDocument deserializeDocumentCompatV2(File file)
215228
return readDocumentFromFileCompatV2(store, file);
216229
}
217230
/**
231+
* Deserializes an SPDX document from a file,
232+
* compatible with SPDX version 2
233+
*
218234
* @param file
219235
* file containing an SPDX document in one of the supported
220236
* SerFileTypes
@@ -235,6 +251,8 @@ public static SpdxDocument deserializeDocumentCompatV2(File file,
235251
}
236252

237253
/**
254+
* Deserializes an SPDX document from a file
255+
*
238256
* @param file
239257
* file containing an SPDX document with the standard file
240258
* extension for the serialization formats
@@ -253,6 +271,8 @@ public static org.spdx.library.model.v3_0_1.core.SpdxDocument deserializeDocumen
253271
return readDocumentFromFileV3(store, file);
254272
}
255273
/**
274+
* Deserializes an SPDX document from a file
275+
*
256276
* @param file
257277
* file containing an SPDX document in one of the supported
258278
* SerFileTypes
@@ -308,6 +328,8 @@ public static void deserializeFile(ISerializableModelStore store, File file) thr
308328
}
309329

310330
/**
331+
* Is the store supporting SPDX version 3
332+
*
311333
* @param store model store
312334
* @return true of the model store support SPDX spec version 3
313335
*/
@@ -316,6 +338,8 @@ public static boolean supportsV3(ISerializableModelStore store) {
316338
}
317339

318340
/**
341+
* Is the store supporting SPDX version 2
342+
*
319343
* @param store model store
320344
* @return true of the model store support SPDX spec version 2
321345
*/
@@ -358,7 +382,9 @@ public static CoreModelObject readDocumentFromFile(ISerializableModelStore store
358382
}
359383

360384
/**
361-
* Reads an SPDX Document from a file
385+
* Reads an SPDX Document from a file,
386+
* compatible with SPDX version 2
387+
*
362388
* @param store Store where the document is to be stored
363389
* @param file File to read the store from
364390
* @return SPDX Document from the store
@@ -375,6 +401,8 @@ public static SpdxDocument readDocumentFromFileCompatV2(ISerializableModelStore
375401
}
376402

377403
/**
404+
* Gets an SPDX document from the model store
405+
*
378406
* @param store model store
379407
* @return returns a document if a single document is found in the model store
380408
* @throws InvalidSPDXAnalysisException
@@ -395,6 +423,9 @@ public static org.spdx.library.model.v3_0_1.core.SpdxDocument getDocFromStore(IS
395423
}
396424

397425
/**
426+
* Gets an SPDX document from the model store,
427+
* compatible with SPDX version 2
428+
*
398429
* @param store model store
399430
* @return returns a document if a single document is found in the model store
400431
* @throws InvalidSPDXAnalysisException

0 commit comments

Comments
 (0)