Interface ResourceProvider

All Known Subinterfaces:
Generator, Project, RootProject
All Known Implementing Classes:
AbstractBndGenerator, AbstractGenerator, AbstractProject, AbstractProvider, BndAnalyzer, BndBaseliner, BootstrapBuild, BootstrapRoot, ClasspathScanner, EclipseConfigurator, JarBuilder, JavaCompiler, Javadoc, JavadocJarGenerator, JavaExecutor, JavaResourceCollector, JavaTool, JUnitTestRunner, LibraryBuilder, MvnPublisher, MvnRepoLookup, PomFileGenerator, ResourceCollector, SourcesJarGenerator, UberJarBuilder, VscodeConfigurator

public interface ResourceProvider

This interface defines access to a resource provider, in particular, to the provider's resources. Resources are accessed by invoking resources with a ResourceRequest. In addition, this interface serves as a factory for creating the ResourceRequest instances used for these invocations.

Note that this interface specifies how a provider is invoked. Resource provider implementations must implement the ResourceProviderSpi.

  • Method Summary

    Modifier and Type
    Method
    Description
    Convenience method to access the build context which is sometimes needed in the context of resource requests.
    Returns the name of this resource provider.
    default <T extends Resource>
    ResourceRequest<T>
    of(Class<T> requested)
    Create a new request for the given resource type.
    of(ResourceType<? extends T> type)
    Create a new request for the given resource.
    default <T extends Resource>
    Stream<T>
    resources(ResourceRequest<T> requested)
    Returns resources provided by this resource provider.
  • Method Details

    • name

      Returns the name of this resource provider.
      Returns:
      the string
    • resources

      default <T extends Resource> Stream<T> resources(ResourceRequest<T> requested)
      Returns resources provided by this resource provider. Short for context().resources(this, request).
      Type Parameters:
      T - the generic type
      Parameters:
      requested - the request
      Returns:
      the stream
    • context

      Convenience method to access the build context which is sometimes needed in the context of resource requests.
      Returns:
      the builder configuration
    • of

      <T extends Resource> ResourceRequest<T> of(ResourceType<? extends T> type)
      Create a new request for the given resource.
      Type Parameters:
      T - the resource type
      Parameters:
      type - the type
      Returns:
      the resource request
    • of

      default <T extends Resource> ResourceRequest<T> of(Class<T> requested)
      Create a new request for the given resource type.
      Type Parameters:
      T - the resource type
      Parameters:
      requested - the requested
      Returns:
      the resource request