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, PublicationContainerpublic 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.
You can create an instance of this type using the factory method ObjectFactory.polymorphicDomainObjectContainer(Class).
| 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, toArrayaddAllLater, addLater, all, all, configureEach, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeadd, addAll, addRule, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getByName, getCollectionSchema, getNamer, getNames, getRules, named, named, named, namedconfigure, create, create, create, maybeCreate, register, registerfindAll, matching, matching, withTypecontainerWithType, 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