Groovy Documentation

org.gradle.api.plugins
[Java] Interface ExtensionAware


public interface ExtensionAware

Represents an object that is able to accept DSL extensions. A DSL extension is basically a custom namespace in the DSL.

To add an extension to this object, you call ExtensionContainer.add on this object's ExtensionContainer, passing the extension object. The extension becomes a dynamic property of this target object:

 extensions.add('custom', new MyPojo())

 // Extension is available as a property
 custom.someProperty = 'value'

 // And as a script block
 custom {
     someProperty = 'value'
 }

 class MyPojo {
     String someProperty
 }
 

Extensions can also be added using a dynamic property accessor on the extension container: project.extensions.myExtension = myPojo is the same as project.extensions.add('myExtension', myPojo).

Many Gradle types implement this interface, either statically or dynamically at runtime.


Method Summary
ExtensionContainer getExtensions()

Returns the set of extensions applied to this object.

 

Method Detail

getExtensions

public ExtensionContainer getExtensions()
Returns the set of extensions applied to this object.


 

Groovy Documentation