Class ExternalReference


  • public class ExternalReference
    extends java.lang.Object
    An "external reference", i.e. a notable link for the component or the SBOM itself.

    External references must have a type and an URL. The sepcification also supports optional comments and hashes which are currently not supported.

    External references appear as children of Component or ExternalReferenceSet elements.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.Comparator<org.cyclonedx.model.ExternalReference> CycloneDxExternalReferenceComparator
      Comparator for CycloneDX external references.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setType​(java.lang.String type)
      Set the type of the external reference.
      void setUrl​(java.lang.String url)
      Set the URL (actually URI) of the external reference.
      org.cyclonedx.model.ExternalReference toCycloneDxExternalReference()
      Maps the instance to a CycloneDX ExternalReference.
      • Methods inherited from class java.lang.Object

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

      • CycloneDxExternalReferenceComparator

        public static final java.util.Comparator<org.cyclonedx.model.ExternalReference> CycloneDxExternalReferenceComparator
        Comparator for CycloneDX external references.

        Sorts by type then by url.

        Since:
        CycloneDX Antlib 0.2
    • Constructor Detail

      • ExternalReference

        public ExternalReference()
    • Method Detail

      • setUrl

        public void setUrl​(java.lang.String url)
        Set the URL (actually URI) of the external reference.

        Required. This setter does not validate the value actually follows the URI syntax.

        Parameters:
        url - reference's URI
      • setType

        public void setType​(java.lang.String type)
        Set the type of the external reference.

        Required.

        Types defined by the specification or the enum names of CycloneDX Core (Java)'s type enum are accepted.

        Parameters:
        type - reference's type
      • toCycloneDxExternalReference

        public org.cyclonedx.model.ExternalReference toCycloneDxExternalReference()
        Maps the instance to a CycloneDX ExternalReference.
        Returns:
        CycloneDX version of this instance.