-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sources to convert CycloneDX 1.4 schema to POJO (#56)
- Loading branch information
1 parent
2fbeffa
commit 1d626a8
Showing
7 changed files
with
2,591 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...-commons/src/main/java/io/github/algomaster99/terminator/commons/cyclonedx/CycloneDX.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.algomaster99.terminator.commons.cyclonedx; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class CycloneDX { | ||
|
||
private CycloneDX() {} | ||
|
||
/** | ||
* Converts the SBOM to a plain old java object | ||
*/ | ||
public static Bom14Schema getPOJO(String bom) throws JsonProcessingException { | ||
final ObjectMapper mapper = new ObjectMapper(); | ||
return mapper.readValue(bom, Bom14Schema.class); | ||
} | ||
} |
Oops, something went wrong.