T
- the (base) container element typeCollection<T>
, org.gradle.util.Configurable<NamedDomainObjectContainer<T>>
, DomainObjectCollection<T>
, Iterable<T>
, NamedDomainObjectCollection<T>
, NamedDomainObjectContainer<T>
, org.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>
, NamedDomainObjectSet<T>
, PolymorphicDomainObjectContainer<T>
, Set<T>
NativeToolChainRegistry
, PlatformContainer
, PublicationContainer
public interface ExtensiblePolymorphicDomainObjectContainer<T> extends PolymorphicDomainObjectContainer<T>, org.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>
PolymorphicDomainObjectContainer
that can be extended at runtime to
create elements of new types.Modifier and Type | Method | Description |
---|---|---|
<U extends T> |
registerBinding(Class<U> type,
Class<? extends U> implementationType) |
Registers a binding from the specified "public" domain object type to the specified implementation type.
|
<U extends T> |
registerFactory(Class<U> type,
Closure<? extends U> factory) |
Registers a factory for creating elements of the specified type.
|
<U extends T> |
registerFactory(Class<U> type,
NamedDomainObjectFactory<? extends U> factory) |
Registers a factory for creating elements of the specified type.
|
parallelStream, removeIf, stream, toArray
addAllLater, addLater, all, all, configureEach, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType
add, addAll, addRule, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getByName, getCollectionSchema, getNamer, getNames, getRules, named, named, named, named
configure, create, create, create, maybeCreate, register, register
findAll, matching, matching, withType
containerWithType, create, create, maybeCreate, register, register
<U extends T> void registerFactory(Class<U> type, NamedDomainObjectFactory<? extends U> factory)
registerFactory
in interface org.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>
U
- the type of objects created by the factorytype
- the type of objects created by the factoryfactory
- the factory to registerIllegalArgumentException
- if the specified type is not a subtype of the container element type<U extends T> void registerFactory(Class<U> type, Closure<? extends U> factory)
U
- the type of objects created by the factorytype
- the type of objects created by the factoryfactory
- the factory to registerIllegalArgumentException
- if the specified type is not a subtype of the container element type<U extends T> void registerBinding(Class<U> type, Class<? extends U> implementationType)
Inject
, its arguments will be injected.
In general, registering a binding is preferable over implementing and registering a factory.
U
- a public domain object typetype
- a public domain object typeimplementationType
- the corresponding implementation type