Class BomJsonGenerator


public class BomJsonGenerator extends AbstractBomGenerator
  • Constructor Details

    • BomJsonGenerator

      public BomJsonGenerator(Bom bom, Version version)
      Constructs a new BomGenerator object.
      Parameters:
      bom - the BOM to generate
      version - the version of the CycloneDX schema to use.
  • 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

      public String toJsonString() throws GeneratorException
      Throws:
      GeneratorException
    • toJsonString

      public String toJsonString(boolean prettyPrint) throws GeneratorException
      Throws:
      GeneratorException
    • toString

      public String toString()
      Creates a text representation of a CycloneDX BoM Document. This method calls toJsonString() and will return an empty string if toJsonString() throws an exception. It's preferred to call toJsonString() directly so that exceptions can be caught.
      Overrides:
      toString in class Object
      Returns:
      a String of the BoM