# 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")
    }

Content copied to clipboard

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")
      }
    }

Content copied to clipboard

#### Since

4.2

#### See also

withGroovyBuilder

## Types

Companion
Link copied to clipboard
object Companion

## Properties

delegate
Link copied to clipboard
abstract val delegate: Any

The delegate of this GroovyBuilderScope.

metaClass
Link copied to clipboard
abstract var metaClass: MetaClass?

## Functions

getProperty
Link copied to clipboard
open fun getProperty(propertyName: String?): Any?
hasProperty
Link copied to clipboard
abstract fun hasProperty(name: String): Boolean

Returns true if the object has a property named name.

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

Invokes with Groovy semantics and no arguments.

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

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

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(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.

invokeMethod
Link copied to clipboard
open fun invokeMethod(name: String?, args: Any?): Any?
setProperty
Link copied to clipboard
open fun setProperty(propertyName: String?, newValue: Any?)