T
- the (base) container element type@Incubating public interface ExtensiblePolymorphicDomainObjectContainer<T> extends PolymorphicDomainObjectContainer<T>
PolymorphicDomainObjectContainer
that can be extended at runtime to
create elements of new types.Modifier and Type | Method and Description |
---|---|
<U extends T> |
registerBinding(Class<U> type,
Class<? extends U> implementationType)
Registers a binding from the specified "public" domain object type to the specified implementation type.
|
<U extends T> |
registerFactory(Class<U> type,
Closure<? extends U> factory)
Registers a factory for creating elements of the specified type.
|
<U extends T> |
registerFactory(Class<U> type,
NamedDomainObjectFactory<? extends U> factory)
Registers a factory for creating elements of the specified type.
|
containerWithType, create, create, maybeCreate
configure, create, create, create, maybeCreate
findAll, matching, matching, withType
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getNames, getRules
all, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType
<U extends T> void registerFactory(Class<U> type, NamedDomainObjectFactory<? extends U> factory)
U
- the type of objects created by the factorytype
- the type of objects created by the factoryfactory
- the factory to registerIllegalArgumentException
- if the specified type is not a subtype of the container element type<U extends T> void registerFactory(Class<U> type, Closure<? extends U> factory)
U
- the type of objects created by the factorytype
- the type of objects created by the factoryfactory
- the factory to registerIllegalArgumentException
- if the specified type is not a subtype of the container element type<U extends T> void registerBinding(Class<U> type, Class<? extends U> implementationType)
Inject
, its arguments will be injected.
In general, registering a binding is preferable over implementing and registering a factory.
U
- a public domain object typetype
- a public domain object typeimplementationType
- the corresponding implementation type