GroovyBuilderScope

interface GroovyBuilderScope : GroovyObject(source)

Provides a dynamic dispatching DSL with Groovy semantics for better integration with plugins that rely on Groovy builders such as the core maven plugin.

It supports Groovy keyword arguments and arbitrary nesting, for instance, the following Groovy code:

repository(url: "scp://repos.mycompany.com/releases") {
authentication(userName: "me", password: "myPassword")
}

Can be mechanically translated to the following Kotlin with the aid of withGroovyBuilder:

withGroovyBuilder {
"repository"("url" to "scp://repos.mycompany.com/releases") {
"authentication"("userName" to "me", "password" to "myPassword")
}
}

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val delegate: Any

The delegate of this GroovyBuilderScope.

Functions

Link copied to clipboard
abstract fun getMetaClass(): MetaClass
Link copied to clipboard
open fun getProperty(p0: String): Any
Link copied to clipboard
@Incubating
abstract fun hasProperty(name: String): Boolean

Returns true if the object has a property named name.

Link copied to clipboard
open operator fun String.invoke(): Any?

Invokes with Groovy semantics and no arguments.

abstract operator fun String.invoke(vararg arguments: Any?): Any?

Invokes with Groovy semantics and arguments.

open operator fun String.invoke(vararg keywordArguments: Pair<String, Any?>): Any?

Invokes with Groovy semantics and named keywordArguments.

open operator fun <T> String.invoke(builder: GroovyBuilderScope.() -> T): Any?

Invokes with Groovy semantics, no arguments, and provides a nested GroovyBuilderScope.

open operator fun <T> String.invoke(vararg arguments: Any?, builder: GroovyBuilderScope.() -> T): Any?

Invokes with Groovy semantics, arguments and provides a nested GroovyBuilderScope.

open operator fun <T> String.invoke(vararg keywordArguments: Pair<String, Any?>, builder: GroovyBuilderScope.() -> T): Any?

Invokes with Groovy semantics, named keywordArguments, and provides a nested GroovyBuilderScope.

Link copied to clipboard
open fun invokeMethod(p0: String, p1: Any): Any
Link copied to clipboard
abstract fun setMetaClass(p0: MetaClass)
Link copied to clipboard
open fun setProperty(p0: String, p1: Any)