For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

registerFactory

abstract fun <U : T?> registerFactory(type: Class<U>, factory: NamedDomainObjectFactory<out U>)(source)

Registers a factory for creating elements of the specified type. Typically, the specified type is an interface type.

Parameters

type

the type of objects created by the factory

factory

the factory to register

<U>

the type of objects created by the factory

Throws

if the specified type is not a subtype of the container element type


abstract fun <U : T?> registerFactory(type: Class<U>, factory: Closure<out U>)(source)

Registers a factory for creating elements of the specified type. Typically, the specified type is an interface type.

Since

1.6

Parameters

type

the type of objects created by the factory

factory

the factory to register

<U>

the type of objects created by the factory

Throws

if the specified type is not a subtype of the container element type