Package org.gradle.api
Schnittstelle ExtensiblePolymorphicDomainObjectContainer<T>
- Typparameter:
T- the (base) container element type
- Alle Superschnittstellen:
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>
- Alle bekannten Unterschnittstellen:
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).
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<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.Von Schnittstelle geerbte Methoden java.util.Collection
parallelStream, removeIf, stream, toArrayVon Schnittstelle geerbte Methoden org.gradle.api.DomainObjectCollection
addAllLater, addLater, all, all, configureEach, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeVon Schnittstelle geerbte Methoden org.gradle.api.NamedDomainObjectCollection
add, addAll, addRule, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getByName, getCollectionSchema, getNamer, getNames, getRules, named, named, named, namedVon Schnittstelle geerbte Methoden org.gradle.api.NamedDomainObjectContainer
configure, create, create, create, maybeCreate, register, registerVon Schnittstelle geerbte Methoden org.gradle.api.NamedDomainObjectSet
findAll, matching, matching, named, withTypeVon Schnittstelle geerbte Methoden org.gradle.api.PolymorphicDomainObjectContainer
containerWithType, create, create, maybeCreate, register, register
-
Methodendetails
-
registerFactory
Registers a factory for creating elements of the specified type. Typically, the specified type is an interface type.- Angegeben von:
registerFactoryin Schnittstelleorg.gradle.api.internal.rules.NamedDomainObjectFactoryRegistry<T>- Typparameter:
U- the type of objects created by the factory- Parameter:
type- the type of objects created by the factoryfactory- the factory to register- Löst aus:
IllegalArgumentException- if the specified type is not a subtype of the container element type
-
registerFactory
Registers a factory for creating elements of the specified type. Typically, the specified type is an interface type.- Typparameter:
U- the type of objects created by the factory- Parameter:
type- the type of objects created by the factoryfactory- the factory to register- Löst aus:
IllegalArgumentException- if the specified type is not a subtype of the container element type
-
registerBinding
Registers 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.
- Typparameter:
U- a public domain object type- Parameter:
type- a public domain object typeimplementationType- the corresponding implementation type
-