Class BomJsonGenerator
java.lang.Object
org.cyclonedx.CycloneDxSchema
org.cyclonedx.generators.AbstractBomGenerator
org.cyclonedx.generators.json.BomJsonGenerator
-
Field Summary
Fields inherited from class AbstractBomGenerator
bom, format, mapper, versionFields inherited from class CycloneDxSchema
ALL_VERSIONS, NS_BOM_10, NS_BOM_11, NS_BOM_12, NS_BOM_13, NS_BOM_14, NS_BOM_15, NS_BOM_16, NS_BOM_LATEST, NS_DEPENDENCY_GRAPH_10, VERSION_LATEST -
Constructor Summary
ConstructorsConstructorDescriptionBomJsonGenerator(Bom bom, Version version) Constructs a new BomGenerator object. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeCreates a CycloneDX BOM from a set of Components.toJsonString(boolean prettyPrint) toString()Creates a text representation of a CycloneDX BoM Document.Methods inherited from class AbstractBomGenerator
getFormat, getSchemaVersion, setupObjectMapperMethods inherited from class CycloneDxSchema
getJsonSchema, getXmlSchema, getXmlSchema
-
Constructor Details
-
BomJsonGenerator
-
-
Method Details
-
toJsonNode
public com.fasterxml.jackson.databind.JsonNode toJsonNode()Creates a CycloneDX BOM from a set of Components.- Returns:
- an JSON Document representing a CycloneDX BoM
- Since:
- 7.0.0
-
toJsonString
- Throws:
GeneratorException
-
toJsonString
- Throws:
GeneratorException
-
toString
Creates a text representation of a CycloneDX BoM Document. This method callstoJsonString()and will return an empty string iftoJsonString()throws an exception. It's preferred to calltoJsonString()directly so that exceptions can be caught.
-