Class OutputFormat


  • public class OutputFormat
    extends org.apache.tools.ant.types.EnumeratedAttribute
    CycloneDX format to use for the SBOM.

    Accepts the enum constants like JSON as well as the lowercase version json and the special value all. The values other than all are directly provided by CycloneDX Core's enum.

    all means the task will emit SBOMs in all formats supported by the selected SpecVersion - i.e. only XML for versions 1.1 and 1.2 and both JSON and XML afterwards.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static OutputFormat JSON
      JSON output format.
      • Fields inherited from class org.apache.tools.ant.types.EnumeratedAttribute

        value
    • Constructor Summary

      Constructors 
      Constructor Description
      OutputFormat()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Iterable<org.cyclonedx.Format> getCycloneDxFormats​(org.cyclonedx.Version version)
      Translates this instance to Formats.
      java.lang.String[] getValues()  
      • Methods inherited from class org.apache.tools.ant.types.EnumeratedAttribute

        containsValue, getIndex, getInstance, getValue, indexOfValue, setValue, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • JSON

        public static final OutputFormat JSON
        JSON output format.
    • Constructor Detail

      • OutputFormat

        public OutputFormat()
    • Method Detail

      • getValues

        public java.lang.String[] getValues()
        Specified by:
        getValues in class org.apache.tools.ant.types.EnumeratedAttribute
      • getCycloneDxFormats

        public java.lang.Iterable<org.cyclonedx.Format> getCycloneDxFormats​(org.cyclonedx.Version version)
        Translates this instance to Formats.
        Parameters:
        version - spec version
        Returns:
        all suported formats of version
        Throws:
        org.apache.tools.ant.BuildException - if the value can not be translated.