interface ExtensionContainer
Allows adding 'namespaced' DSL extensions to a target object.
abstract fun <T : Any> add(publicType: Class<T>, name: String, extension: T): Unit abstract fun <T : Any> add(publicType: TypeOf<T>, name: String, extension: T): Unit
Adds a new extension to this container. Adding an extension of name 'foo' will:
publicType .
abstract fun add(name: String, extension: Any): Unit
Adds a new extension to this container. Adding an extension of name 'foo' will:
extension.getClass() unless the extension itself declares a preferred public type via the org.gradle.api.reflect.HasPublicType protocol.
|
|
abstract fun <T : Any> configure(type: Class<T>, action: Action<in T>): Unit abstract fun <T : Any> configure(type: TypeOf<T>, action: Action<in T>): Unit
Looks for the extension of the specified type and configures it with the supplied action. abstract fun <T : Any> configure(name: String, action: Action<in T>): Unit
Looks for the extension with the specified name and configures it with the supplied action. |
|
abstract fun <T : Any> create(publicType: Class<T>, name: String, instanceType: Class<out T>, vararg constructionArguments: Any): T abstract fun <T : Any> create(publicType: TypeOf<T>, name: String, instanceType: Class<out T>, vararg constructionArguments: Any): T
Creates and adds a new extension to this container. A new instance of the given abstract fun <T : Any> create(name: String, type: Class<T>, vararg constructionArguments: Any): T
Creates and adds a new extension to this container. A new instance of the given |
|
abstract fun findByName(name: String): Any
Looks for the extension of a given name. If none found null is returned. |
|
abstract fun <T : Any> findByType(type: Class<T>): T abstract fun <T : Any> findByType(type: TypeOf<T>): T
Looks for the extension of a given type (useful to avoid casting). If none found null is returned. |
|
abstract fun getByName(name: String): Any
Looks for the extension of a given name. If none found it will throw an exception. |
|
abstract fun <T : Any> getByType(type: Class<T>): T abstract fun <T : Any> getByType(type: TypeOf<T>): T
Looks for the extension of a given type (useful to avoid casting). If none found it will throw an exception. |
|
abstract fun getExtensionsSchema(): ExtensionsSchema
Provides access to the schema of all known extensions. |
|
abstract fun getExtraProperties(): ExtraPropertiesExtension
The extra properties extension in this extension container. This extension is always present in the container, with the name “ext”. |
|
abstract fun
Provides access to all known extensions types. |
operator fun ExtensionContainer.get(name: String): Any
Looks for the extension of a given name. If none found it will throw an exception. |
|
fun <T : Any> ExtensionContainer.getByName(name: String): T
Looks for the extension of a given name and casts it to the expected type T. |
|
operator fun <T : Any> ExtensionContainer.getValue(thisRef: Any?, property: KProperty<*>): T |
interface Convention : ExtensionContainer
A |