|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ExtensionContainer
Allows adding 'namespaced' DSL extensions to a target object.
| Method Summary | ||
|---|---|---|
void |
add(String name,
Class<?> type,
Object... constructionArguments)
Deprecated. use create(java.lang.String, java.lang.Class |
|
void |
add(String name,
Object extension)
Adding an extension of name 'foo' will: add 'foo' dynamic property add 'foo' dynamic method that accepts a closure that is a configuration script block |
|
|
create(String name,
Class<T> 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. |
|
|
findByType(Class<T> 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. |
|
|
getByType(Class<T> 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 |
|---|
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
void add(String name,
Class<?> type,
Object... constructionArguments)
create(java.lang.String, java.lang.Class, java.lang.Object...)
create(java.lang.String, java.lang.Class, java.lang.Object...)
name - The name for the extensiontype - The type of the extensionconstructionArguments - The arguments to be used to construct the extension instance
<T> T create(String name,
Class<T> type,
Object... constructionArguments)
ExtensionAware.
A new instance of the given type will be created using the given constructionArguments. The new
instance will have been dynamically which means that you can cast the object to ExtensionAware.
name - The name for the extensiontype - The type of the extensionconstructionArguments - The arguments to be used to construct the extension instance
add(String, Object)
<T> T getByType(Class<T> type)
throws UnknownDomainObjectException
type - extension type
UnknownDomainObjectException - When the given extension is not found.<T> T findByType(Class<T> type)
type - extension type
Object getByName(String name)
throws UnknownDomainObjectException
name - extension name
UnknownDomainObjectException - When the given extension is not found.Object findByName(String name)
name - extension name
ExtraPropertiesExtension getExtraProperties()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||