public interface DIObjectFactory
| Modifier and Type | Method and Description |
|---|---|
<T> T |
instance(Class<T> type) |
<T> T |
newInstance(Class<T> type,
Object... params)
Creates a fresh instance of a given type using constructor injection on a potential implementation type.
|
<T> T |
registerInstance(Class<T> type,
T instance) |
String |
registerStringLiteral(String key,
String value) |
String[] |
registerStringLiteralArray(String key,
String[] valuesArray) |
<T> T newInstance(Class<T> type, Object... params) throws IllegalArgumentException
Only ONE implementation of the given is allowed to be available in the scanned classpath.
This method always returns a new instance of the give type.
T - describes the type parametertype - the type to create an instance forparams - the parameters to be used to createIllegalArgumentException - if type is null, if any of the given parameters is null, if no implementation type was found, or if 2 or more implementations types are found<T> T instance(Class<T> type) throws IllegalArgumentException
IllegalArgumentException<T> T registerInstance(Class<T> type, T instance) throws IllegalArgumentException
IllegalArgumentExceptionString registerStringLiteral(String key, String value) throws IllegalArgumentException
IllegalArgumentExceptionString[] registerStringLiteralArray(String key, String[] valuesArray) throws IllegalArgumentException
IllegalArgumentExceptionCopyright © 2014. All rights reserved.