Interface Parser

All Known Implementing Classes:
JsonParser, XmlParser

public interface Parser
  • Method Details

    • parse

      Bom parse(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(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(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

      List<ParseException> validate(File file) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(File file, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(byte[] bomBytes) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(byte[] bomBytes, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(Reader reader) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(Reader reader, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(InputStream inputStream) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • validate

      List<ParseException> validate(InputStream inputStream, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(File file) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(File file, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(byte[] bomBytes) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(byte[] bomBytes, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(Reader reader) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(Reader reader, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(InputStream inputStream) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0
    • isValid

      boolean isValid(InputStream inputStream, Version schemaVersion) throws 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:
      IOException - when errors are encountered
      Since:
      3.0.0