Interface ResourceProvider

All Known Subinterfaces:
Generator, Project, RootProject
All Known Implementing Classes:
AbstractGenerator, AbstractProject, AbstractProvider, BootstrapBuild, BootstrapRoot, ClasspathScanner, EclipseConfigurator, JarGenerator, JavaCompiler, Javadoc, JavadocJarGenerator, JavaResourceCollector, JavaTool, LibraryGenerator, MvnPublisher, MvnRepoLookup, PomFileGenerator, ResourceCollector, SourcesJarGenerator, UberJarGenerator, VscodeConfigurator

public interface ResourceProvider
A provider of a resource. This interface is intended to be implemented by providers. It is not intended to be invoked directly. Rather, it must be invoked via BuildContext.get(ResourceProvider, ResourceRequest).
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Resource>
    Stream<T>
    provide(ResourceRequest<T> requested)
    Provide the requested resources.
  • Method Details

    • provide

      <T extends Resource> Stream<T> provide(ResourceRequest<T> requested)

      Provide the requested resources.

      This method is never invoked concurrently for the same request when invoked through Project.get(PropertyKey). It may, however, be invoked concurrently for different requests. Providers that evaluate all possibly provided resources anyway and return only a subset for some kinds of request should therefore invoke themselves (through Project.get(PropertyKey)) with a request for all resources and filter the (automatically cached) result.

      Type Parameters:
      T - the type of the requested (and provided) resource
      Parameters:
      requested - the requested resources
      Returns:
      the provided resource(s) as stream