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 resources provided by the given stream.final ResourceCollector<T> Adds the given resources.protected <R extends Resource>
Collection<R> 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, project, toStringMethods inherited from class AbstractProvider
context, name, of, rename, vavrStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
context, name, of, resources
-
Constructor Details
-
ResourceCollector
Instantiates a new resources collector.- Parameters:
project- the projecttype- the type of resources to collect
-
-
Method Details
-
add
Adds the given resources.- Parameters:
resources- the resources- Returns:
- the resources collector
-
add
Adds the resources provided by the given stream.- 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 request for resources- Returns:
- the stream
-