|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
@HasInternalProtocol public interface ExtensionContainer
Allows adding 'namespaced' DSL extensions to a target object.
Method Summary | |
---|---|
void
|
add(String name, Object extension)
Adding an extension of name 'foo' will: |
void
|
add(String name, Class type, Object... constructionArguments)
Deprecated. |
void
|
configure(Class type, Action action)
Looks for the extension of the specified type and configures it with the supplied action. |
Object
|
create(String name, Class type, Object... constructionArguments)
Adds a new extension to this container, that itself is dynamically made ExtensionAware. |
Object
|
findByName(String name)
Looks for the extension of a given name. |
Object
|
findByType(Class type)
Looks for the extension of a given type (useful to avoid casting). |
Object
|
getByName(String name)
Looks for the extension of a given name. |
Object
|
getByType(Class type)
Looks for the extension of a given type (useful to avoid casting). |
ExtraPropertiesExtension
|
getExtraProperties()
The extra properties extension in this extension container. |
Method Detail |
---|
public void add(String name, Object extension)
name
- Will be used as a sort of namespace of properties/methods.extension
- Any object whose methods and properties will extend the target object
@Deprecated public void add(String name, Class type, Object... constructionArguments)
name
- The name for the extensiontype
- The type of the extensionconstructionArguments
- The arguments to be used to construct the extension instance
@Incubating public void configure(Class type, Action action)
type
- extension typeaction
- the configure action
public Object create(String name, Class type, Object... constructionArguments)
name
- The name for the extensiontype
- The type of the extensionconstructionArguments
- The arguments to be used to construct the extension instance
public Object findByName(String name)
name
- extension name
public Object findByType(Class type)
type
- extension type
public Object getByName(String name)
name
- extension name
public Object getByType(Class type)
type
- extension type
public ExtraPropertiesExtension getExtraProperties()
Gradle API 1.12