Class BomJsonGenerator

    • Field Detail

      • prettyPrinter

        private final com.fasterxml.jackson.core.util.DefaultPrettyPrinter prettyPrinter
    • Constructor Detail

      • 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 Detail

      • setupObjectMapper

        private void setupObjectMapper()
      • setupPrettyPrinter

        private void setupPrettyPrinter​(com.fasterxml.jackson.core.util.DefaultPrettyPrinter prettyPrinter)
      • 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
      • toString

        public java.lang.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 java.lang.Object
        Returns:
        a String of the BoM