Package org.gradle.api
Interface ExtensiblePolymorphicDomainObjectContainer<T>
- Type Parameters:
- T- the (base) container element type
- All Superinterfaces:
- Collection<T>,- Configurable<NamedDomainObjectContainer<T>>,- DomainObjectCollection<T>,- DomainObjectSet<T>,- Iterable<T>,- NamedDomainObjectCollection<T>,- NamedDomainObjectContainer<T>,- org.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>,- NamedDomainObjectSet<T>,- PolymorphicDomainObjectContainer<T>,- Set<T>
- All Known Subinterfaces:
- NativeToolChainRegistry,- PlatformContainer,- PublicationContainer,- SoftwareComponentContainer
public interface ExtensiblePolymorphicDomainObjectContainer<T>
extends PolymorphicDomainObjectContainer<T>, org.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>
A 
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).
- 
Method SummaryModifier and TypeMethodDescription<U extends T>
 voidregisterBinding(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>
 voidregisterFactory(Class<U> type, Closure<? extends U> factory) Registers a factory for creating elements of the specified type.<U extends T>
 voidregisterFactory(Class<U> type, NamedDomainObjectFactory<? extends U> factory) Registers a factory for creating elements of the specified type.Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface org.gradle.api.DomainObjectCollectionaddAllLater, addLater, all, all, configureEach, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeMethods inherited from interface org.gradle.api.NamedDomainObjectCollectionadd, addAll, addRule, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getByName, getCollectionSchema, getNamer, getNames, getRules, named, named, named, namedMethods inherited from interface org.gradle.api.NamedDomainObjectContainerconfigure, create, create, create, maybeCreate, register, registerMethods inherited from interface org.gradle.api.NamedDomainObjectSetfindAll, matching, matching, named, withTypeMethods inherited from interface org.gradle.api.PolymorphicDomainObjectContainercontainerWithType, create, create, maybeCreate, register, register
- 
Method Details- 
registerFactoryRegisters a factory for creating elements of the specified type. Typically, the specified type is an interface type.- Specified by:
- registerFactoryin interface- org.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>
- Type Parameters:
- U- the type of objects created by the factory
- Parameters:
- type- the type of objects created by the factory
- factory- the factory to register
- Throws:
- IllegalArgumentException- if the specified type is not a subtype of the container element type
 
- 
registerFactoryRegisters a factory for creating elements of the specified type. Typically, the specified type is an interface type.- Type Parameters:
- U- the type of objects created by the factory
- Parameters:
- type- the type of objects created by the factory
- factory- the factory to register
- Throws:
- IllegalArgumentException- if the specified type is not a subtype of the container element type
 
- 
registerBindingRegisters a binding from the specified "public" domain object type to the specified implementation type. Whenever the container is asked to create an element with the binding's public type, it will instantiate the binding's implementation type. If the implementation type has a constructor annotated withInject, its arguments will be injected.The implementation type may also be an interface that has a read-only nameproperty of type String, and is otherwise empty or consists entirely of managed properties.In general, registering a binding is preferable over implementing and registering a factory. - Type Parameters:
- U- a public domain object type
- Parameters:
- type- a public domain object type
- implementationType- the corresponding implementation type
 
 
-