public class UniversalFactory extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
UniversalFactory.FactorySpi<T>
Interface for object factory.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
createInstance(String key)
Creates instance of object with given name.
|
static void |
setSpi(String key,
UniversalFactory.FactorySpi<?> spi)
Registers object factory with name.
|
static void |
setSpi(String key,
UniversalFactory.FactorySpi<?> spi,
boolean overwrite)
Registers object factory with name.
|
public static <T> T createInstance(String key)
key - name of object.null if no factory is
registered for that name.public static void setSpi(String key, UniversalFactory.FactorySpi<?> spi)
key - name of object factory.spi - implementation of factory.public static void setSpi(String key, UniversalFactory.FactorySpi<?> spi, boolean overwrite)
key - name of object factory.spi - implementation of factory.overwrite - true if previously registered factory should be
overwritten.Copyright © 2006–2016 Tigase. All rights reserved.