Class ResourceCollector<T extends Resource>
java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.AbstractGenerator
org.jdrupes.builder.core.ResourceCollector<T>
- Type Parameters:
T- the resource type
- All Implemented Interfaces:
Generator, Renamable, ResourceProvider
- Direct Known Subclasses:
JavaResourceCollector
A provider of resources to be included in a project. This
implementation can be used for all kinds of resources. Usually
language specific packages derive specializations that bind
this class to a specific type of resource. These specializations
often also offer methods that ease the specification of resources
to be included.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceCollector(Project project, ResourceType<T> type) Instantiates a new resources collector. -
Method Summary
Modifier and TypeMethodDescriptionfinal ResourceCollector<T> Adds the given file trees with resource directories.final ResourceCollector<T> Adds the given file tree with resource directories.doProvide(ResourceRequest<R> requested) Invoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.Return the resources to collect.Methods inherited from class AbstractGenerator
cleanup, name, newResource, project, toStringMethods inherited from class AbstractProvider
context, name, of, rename, vavrStream
-
Constructor Details
-
ResourceCollector
Instantiates a new resources collector.- Parameters:
project- the projecttype- the type of resources to collect
-
-
Method Details
-
add
Adds the given file tree with resource directories.- Parameters:
resources- the resources- Returns:
- the resources collector
-
add
Adds the given file trees with resource directories.- Parameters:
resources- the resources- Returns:
- the resources collector
-
resources
-
doProvide
Description copied from class:AbstractProviderInvoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
R- the generic type- Parameters:
requested- the requested- Returns:
- the stream
-