Interface Parser

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isValid​(byte[] bomBytes)
      Verifies a CycloneDX BOM conforms to the latest version of the specification.
      boolean isValid​(byte[] bomBytes, Version schemaVersion)
      Verifies a CycloneDX BOM conforms to the specified specification version.
      boolean isValid​(java.io.File file)
      Verifies a CycloneDX BOM conforms to the latest version of the specification.
      boolean isValid​(java.io.File file, Version schemaVersion)
      Verifies a CycloneDX BOM conforms to the specified specification version.
      boolean isValid​(java.io.InputStream inputStream)
      Verifies a CycloneDX BOM conforms to the latest version of the specification.
      boolean isValid​(java.io.InputStream inputStream, Version schemaVersion)
      Verifies a CycloneDX BOM conforms to the specified specification version.
      boolean isValid​(java.io.Reader reader)
      Verifies a CycloneDX BOM conforms to the latest version of the specification.
      boolean isValid​(java.io.Reader reader, Version schemaVersion)
      Verifies a CycloneDX BOM conforms to the specified specification version.
      Bom parse​(byte[] bomBytes)
      Parses a CycloneDX BOM.
      Bom parse​(java.io.File file)
      Parses a CycloneDX BOM.
      Bom parse​(java.io.InputStream inputStream)
      Parses a CycloneDX BOM.
      Bom parse​(java.io.Reader reader)
      Parses a CycloneDX BOM.
      java.util.List<ParseException> validate​(byte[] bomBytes)
      Validates a CycloneDX BOM.
      java.util.List<ParseException> validate​(byte[] bomBytes, Version schemaVersion)
      Validates a CycloneDX BOM conforms to a specific specification version.
      java.util.List<ParseException> validate​(java.io.File file)
      Validates a CycloneDX BOM.
      java.util.List<ParseException> validate​(java.io.File file, Version schemaVersion)
      Validates a CycloneDX BOM conforms to a specific specification version.
      java.util.List<ParseException> validate​(java.io.InputStream inputStream)
      Validates a CycloneDX BOM.
      java.util.List<ParseException> validate​(java.io.InputStream inputStream, Version schemaVersion)
      Validates a CycloneDX BOM conforms to a specific specification version.
      java.util.List<ParseException> validate​(java.io.Reader reader)
      Validates a CycloneDX BOM.
      java.util.List<ParseException> validate​(java.io.Reader reader, Version schemaVersion)
      Validates a CycloneDX BOM conforms to a specific specification version.
    • Method Detail

      • parse

        Bom parse​(java.io.File file)
           throws ParseException
        Parses a CycloneDX BOM.
        Parameters:
        file - a File to parse
        Returns:
        a Bom object
        Throws:
        ParseException - when errors are encountered
        Since:
        3.0.0
      • parse

        Bom parse​(byte[] bomBytes)
           throws ParseException
        Parses a CycloneDX BOM.
        Parameters:
        bomBytes - the byte array to parse
        Returns:
        a Bom object
        Throws:
        ParseException - when errors are encountered
        Since:
        3.0.0
      • parse

        Bom parse​(java.io.Reader reader)
           throws ParseException
        Parses a CycloneDX BOM.
        Parameters:
        reader - the Reader from which to parse
        Returns:
        a Bom object
        Throws:
        ParseException - when errors are encountered
        Since:
        3.0.0
      • parse

        Bom parse​(java.io.InputStream inputStream)
           throws ParseException
        Parses a CycloneDX BOM.
        Parameters:
        inputStream - the InputStream from which to parse
        Returns:
        a Bom object
        Throws:
        ParseException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(java.io.File file)
                                         throws java.io.IOException
        Validates a CycloneDX BOM.
        Parameters:
        file - the CycloneDX BOM file to validate
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(java.io.File file,
                                                Version schemaVersion)
                                         throws java.io.IOException
        Validates a CycloneDX BOM conforms to a specific specification version.
        Parameters:
        file - the CycloneDX BOM file to validate
        schemaVersion - the schema version to validate against
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(byte[] bomBytes)
                                         throws java.io.IOException
        Validates a CycloneDX BOM.
        Parameters:
        bomBytes - the byte array to validate
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(byte[] bomBytes,
                                                Version schemaVersion)
                                         throws java.io.IOException
        Validates a CycloneDX BOM conforms to a specific specification version.
        Parameters:
        bomBytes - the byte array to validate
        schemaVersion - the schema version to validate against
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(java.io.Reader reader)
                                         throws java.io.IOException
        Validates a CycloneDX BOM.
        Parameters:
        reader - the Reader from which to parse
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(java.io.Reader reader,
                                                Version schemaVersion)
                                         throws java.io.IOException
        Validates a CycloneDX BOM conforms to a specific specification version.
        Parameters:
        reader - the Reader from which to parse
        schemaVersion - the schema version to validate against
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(java.io.InputStream inputStream)
                                         throws java.io.IOException
        Validates a CycloneDX BOM.
        Parameters:
        inputStream - the InputStream from which to validate
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • validate

        java.util.List<ParseException> validate​(java.io.InputStream inputStream,
                                                Version schemaVersion)
                                         throws java.io.IOException
        Validates a CycloneDX BOM conforms to a specific specification version.
        Parameters:
        inputStream - the InputStream from which to validate
        schemaVersion - the schema version to validate against
        Returns:
        a List of ParseException. If the size of the list is 0, validation was successful
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(java.io.File file)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the latest version of the specification.
        Parameters:
        file - the CycloneDX BOM file to validate
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(java.io.File file,
                        Version schemaVersion)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the specified specification version.
        Parameters:
        file - the CycloneDX BOM file to validate
        schemaVersion - the schema version to validate against
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(byte[] bomBytes)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the latest version of the specification.
        Parameters:
        bomBytes - the byte array to validate
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(byte[] bomBytes,
                        Version schemaVersion)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the specified specification version.
        Parameters:
        bomBytes - the byte array to validate
        schemaVersion - the schema version to validate against
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(java.io.Reader reader)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the latest version of the specification.
        Parameters:
        reader - the Reader from which to validate
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(java.io.Reader reader,
                        Version schemaVersion)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the specified specification version.
        Parameters:
        reader - the Reader from which to validate
        schemaVersion - the schema version to validate against
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(java.io.InputStream inputStream)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the latest version of the specification.
        Parameters:
        inputStream - the InputStream from which to validate
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0
      • isValid

        boolean isValid​(java.io.InputStream inputStream,
                        Version schemaVersion)
                 throws java.io.IOException
        Verifies a CycloneDX BOM conforms to the specified specification version.
        Parameters:
        inputStream - the InputStream from which to validate
        schemaVersion - the schema version to validate against
        Returns:
        true if the file is a valid BOM, false if not
        Throws:
        java.io.IOException - when errors are encountered
        Since:
        3.0.0