Class Snippet

  • All Implemented Interfaces:

    
    public final class Snippet
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Float getScore() The matching score between the code being scanned and the code snippet.
      final TextLocation getLocation() The text location in the snippet that has matched.
      final KnownProvenance getProvenance() The provenance of the snippet, either an artifact or a repository.
      final String getPurl() The purl representing the author/vendor, artifact, version of the code snippet.
      final SpdxExpression getLicenses() The license of the component the code snippet is commit from.
      final Map<String, String> getAdditionalData() A map for scanner specific snippet data that cannot be mapped into any generalized property, but still needs to be made available in the scan summary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getScore

         final Float getScore()

        The matching score between the code being scanned and the code snippet. This is scanner specific (e.g. for ScanOSS this is a percentage).

      • getPurl

         final String getPurl()

        The purl representing the author/vendor, artifact, version of the code snippet. If the snippet scanner does not natively support purls, it will be generated by ORT.

      • getLicenses

         final SpdxExpression getLicenses()

        The license of the component the code snippet is commit from.

      • getAdditionalData

         final Map<String, String> getAdditionalData()

        A map for scanner specific snippet data that cannot be mapped into any generalized property, but still needs to be made available in the scan summary.