public interface FactoryCollection extends FactoryLookup
| Modifier and Type | Method and Description |
|---|---|
void |
addFactory(Class<?> clazz,
Factory<?> factory)
Add the specified Factory to the collection.
|
void |
addFactoryLookup(FactoryLookup factoryLookup)
Add the specified FactoryLookup
|
static FactoryCollection |
getInstance() |
static ServiceDefinition<FactoryCollection> |
getServiceDefinition() |
getFactory, getFactoryIfAvailable, hasFactoryvoid addFactory(Class<?> clazz, Factory<?> factory) throws IllegalArgumentException
Add the specified Factory to the collection.
If a Factory is already registered against the specified class, the existing registered Factory will be replaced with the Factory you specify here.
clazz - The type of objects the Factory creates. The class type will be used to generate a key with which the
Factory can be retrieved from the collection at a later stage.factory - The Factory to add to the collection.IllegalArgumentException - If either of the required parameters are deemed illegal.void addFactoryLookup(FactoryLookup factoryLookup)
Add the specified FactoryLookup
The factoryLookup will be first consulted when looking for a Factorystatic ServiceDefinition<FactoryCollection> getServiceDefinition()
getServiceDefinition in interface FactoryLookupstatic FactoryCollection getInstance()
getInstance in interface FactoryLookupCopyright © 2010–2020 meanbean. All rights reserved.