Convention
public interface ExtensionContainer
Modifier and Type | Method | Description |
---|---|---|
<T> void |
add(java.lang.Class<T> publicType,
java.lang.String name,
T extension) |
Adds a new extension to this container.
|
void |
add(java.lang.String name,
java.lang.Object extension) |
Adds a new extension to this container.
|
<T> void |
add(TypeOf<T> publicType,
java.lang.String name,
T extension) |
Adds a new extension to this container.
|
<T> void |
configure(java.lang.Class<T> type,
Action<? super T> action) |
Looks for the extension of the specified type and configures it with the supplied action.
|
<T> void |
configure(java.lang.String name,
Action<? super T> action) |
Looks for the extension with the specified name and configures it with the supplied action.
|
<T> void |
configure(TypeOf<T> type,
Action<? super T> action) |
Looks for the extension of the specified type and configures it with the supplied action.
|
<T> T |
create(java.lang.Class<T> publicType,
java.lang.String name,
java.lang.Class<? extends T> instanceType,
java.lang.Object... constructionArguments) |
Creates and adds a new extension to this container.
|
<T> T |
create(java.lang.String name,
java.lang.Class<T> type,
java.lang.Object... constructionArguments) |
Creates and adds a new extension to this container.
|
<T> T |
create(TypeOf<T> publicType,
java.lang.String name,
java.lang.Class<? extends T> instanceType,
java.lang.Object... constructionArguments) |
Creates and adds a new extension to this container.
|
java.lang.Object |
findByName(java.lang.String name) |
Looks for the extension of a given name.
|
<T> T |
findByType(java.lang.Class<T> type) |
Looks for the extension of a given type (useful to avoid casting).
|
<T> T |
findByType(TypeOf<T> type) |
Looks for the extension of a given type (useful to avoid casting).
|
java.lang.Object |
getByName(java.lang.String name) |
Looks for the extension of a given name.
|
<T> T |
getByType(java.lang.Class<T> type) |
Looks for the extension of a given type (useful to avoid casting).
|
<T> T |
getByType(TypeOf<T> type) |
Looks for the extension of a given type (useful to avoid casting).
|
ExtensionsSchema |
getExtensionsSchema() |
Provides access to the schema of all known extensions.
|
ExtraPropertiesExtension |
getExtraProperties() |
The extra properties extension in this extension container.
|
<T> void add(java.lang.Class<T> publicType, java.lang.String name, T extension)
publicType
.publicType
- The extension public typename
- The name for the extensionextension
- Any object implementing publicType
java.lang.IllegalArgumentException
- When an extension with the given name already exists.<T> void add(TypeOf<T> publicType, java.lang.String name, T extension)
publicType
.publicType
- The extension public typename
- The name for the extensionextension
- Any object implementing publicType
java.lang.IllegalArgumentException
- When an extension with the given name already exists.void add(java.lang.String name, java.lang.Object extension)
extension.getClass()
unless the extension itself declares a preferred public type via the HasPublicType
protocol.name
- The name for the extensionextension
- Any objectjava.lang.IllegalArgumentException
- When an extension with the given name already exists<T> T create(java.lang.Class<T> publicType, java.lang.String name, java.lang.Class<? extends T> instanceType, java.lang.Object... constructionArguments)
instanceType
will be created using the given constructionArguments
.
The extension will be exposed as publicType
.
The new instance will have been dynamically made ExtensionAware
, which means that you can cast it to ExtensionAware
.T
- the extension public typepublicType
- The extension public typename
- The name for the extensioninstanceType
- The extension instance typeconstructionArguments
- The arguments to be used to construct the extension instancejava.lang.IllegalArgumentException
- When an extension with the given name already exists.add(Class, String, Object)
<T> T create(TypeOf<T> publicType, java.lang.String name, java.lang.Class<? extends T> instanceType, java.lang.Object... constructionArguments)
instanceType
will be created using the given constructionArguments
.
The extension will be exposed as publicType
.
The new instance will have been dynamically made ExtensionAware
, which means that you can cast it to ExtensionAware
.T
- the extension public typepublicType
- The extension public typename
- The name for the extensioninstanceType
- The extension instance typeconstructionArguments
- The arguments to be used to construct the extension instancejava.lang.IllegalArgumentException
- When an extension with the given name already exists.add(Class, String, Object)
<T> T create(java.lang.String name, java.lang.Class<T> type, java.lang.Object... constructionArguments)
type
will be created using the given constructionArguments
.
The extension will be exposed as type
unless the extension itself declares a preferred public type via the HasPublicType
protocol.
The new instance will have been dynamically made ExtensionAware
, which means that you can cast it to ExtensionAware
.name
- The name for the extensiontype
- The type of the extensionconstructionArguments
- The arguments to be used to construct the extension instancejava.lang.IllegalArgumentException
- When an extension with the given name already exists.add(String, Object)
ExtensionsSchema getExtensionsSchema()
<T> T getByType(java.lang.Class<T> type) throws UnknownDomainObjectException
type
- extension typeUnknownDomainObjectException
- When the given extension is not found.<T> T getByType(TypeOf<T> type) throws UnknownDomainObjectException
type
- extension typeUnknownDomainObjectException
- When the given extension is not found.@Nullable <T> T findByType(java.lang.Class<T> type)
type
- extension type@Nullable <T> T findByType(TypeOf<T> type)
type
- extension typejava.lang.Object getByName(java.lang.String name) throws UnknownDomainObjectException
name
- extension nameUnknownDomainObjectException
- When the given extension is not found.@Nullable java.lang.Object findByName(java.lang.String name)
name
- extension name<T> void configure(java.lang.Class<T> type, Action<? super T> action)
type
- extension typeaction
- the configure actionUnknownDomainObjectException
- if no extension is found.<T> void configure(TypeOf<T> type, Action<? super T> action)
type
- extension typeaction
- the configure actionUnknownDomainObjectException
- if no extension is found.<T> void configure(java.lang.String name, Action<? super T> action)
name
- extension nameaction
- the configure actionUnknownDomainObjectException
- if no extension is found.ExtraPropertiesExtension getExtraProperties()