|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
org.gradle.api.NamedDomainObjectSet org.gradle.api.PolymorphicDomainObjectContainer org.gradle.api.NamedDomainObjectContainer org.gradle.api.ExtensiblePolymorphicDomainObjectContainer org.gradle.api.NamedDomainObjectCollection java.lang.Iterable org.gradle.api.DomainObjectCollection org.gradle.util.Configurable java.util.Collection
@Incubating public interface ExtensiblePolymorphicDomainObjectContainer extends PolymorphicDomainObjectContainer
A PolymorphicDomainObjectContainer that can be extended at runtime to create elements of new types.
- the (base) container element typeMethod Summary | |
---|---|
void
|
registerBinding(Class type, Class implementationType)
Registers a binding from the specified "public" domain object type to the specified implementation type. |
void
|
registerFactory(Class type, NamedDomainObjectFactory factory)
Registers a factory for creating elements of the specified type. |
void
|
registerFactory(Class type, Closure factory)
Registers a factory for creating elements of the specified type. |
Methods inherited from interface PolymorphicDomainObjectContainer | |
---|---|
create, create, maybeCreate |
Methods inherited from interface NamedDomainObjectContainer | |
---|---|
configure, create, create, create, maybeCreate |
Methods inherited from interface NamedDomainObjectSet | |
---|---|
findAll, matching, matching, withType |
Method Detail |
---|
public void registerBinding(Class type, Class implementationType)
In general, registering a binding is preferable over implementing and registering a factory.
type
- a public domain object typeimplementationType
- the corresponding implementation type
- a public domain object type
public void registerFactory(Class type, NamedDomainObjectFactory factory)
type
- the type of objects created by the factoryfactory
- the factory to register
- the type of objects created by the factory
public void registerFactory(Class type, Closure factory)
type
- the type of objects created by the factoryfactory
- the factory to register
- the type of objects created by the factory
Gradle API 1.12