Class SbomLinkComponentResolver

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<org.apache.tools.ant.types.Resource>, ComponentResolver, org.apache.tools.ant.types.ResourceCollection, org.apache.tools.ant.types.resources.AppendableResourceCollection

    public class SbomLinkComponentResolver
    extends org.apache.tools.ant.types.resources.Union
    implements ComponentResolver
    Reads a linked SBOM and configures the component containing the link.
    Since:
    CycloneDX Antlib 0.2
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.types.DataType

        checked, ref
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<Component> resolve​(Component parent)
      Configures the given component and only adds dependencies if the component doesn't already know about any dependencies itself.
      void setCreateBomExternalReference​(boolean create)
      Whether to create a bom-Type external reference in the resolved component based on the nested resource's URI.
      • Methods inherited from class org.apache.tools.ant.types.resources.Union

        getAllResources, getAllToStrings, getCollection, getCollection, getInstance, list, listResources
      • Methods inherited from class org.apache.tools.ant.types.resources.BaseResourceCollectionContainer

        add, addAll, clear, clone, dieOnCircularReference, getResourceCollections, isCache, isFilesystemOnly, iterator, setCache, size, toString
      • Methods inherited from class org.apache.tools.ant.types.DataType

        checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface org.apache.tools.ant.types.ResourceCollection

        isEmpty, stream
    • Constructor Detail

      • SbomLinkComponentResolver

        public SbomLinkComponentResolver()
    • Method Detail

      • setCreateBomExternalReference

        public void setCreateBomExternalReference​(boolean create)
        Whether to create a bom-Type external reference in the resolved component based on the nested resource's URI.

        Will not create an external reference of there are already external references om the component or the resolved SBOM already contains a bom-type reference.

        Defaults to true.

        Parameters:
        create - whether to create a bom-Type external reference
      • resolve

        public java.util.Collection<Component> resolve​(Component parent)
                                                throws java.io.IOException,
                                                       org.apache.tools.ant.BuildException
        Configures the given component and only adds dependencies if the component doesn't already know about any dependencies itself.
        Specified by:
        resolve in interface ComponentResolver
        Parameters:
        parent - component the link applies to
        Returns:
        Components that are direct dependencies of the parent component
        Throws:
        java.io.IOException - if resolution fails
        org.apache.tools.ant.BuildException