public class DIObjectFactoryHelper extends Object
| Constructor and Description |
|---|
DIObjectFactoryHelper(String packagePrefix,
Map<Class<?>,Class<?>> wrappedPrimitiveTypeMap) |
| Modifier and Type | Method and Description |
|---|---|
Object |
instance(Class<?> type)
Looks up or creates an instance of the given type.
|
<T> T |
newInstance(Class<T> type,
Object... params) |
Object |
registerInstance(Class<?> type,
Object instance) |
String |
registerStringLiteral(String key,
String singleValue) |
String[] |
registerStringLiteralArray(String key,
String[] arrayValue) |
public Object instance(Class<?> type) throws IllegalArgumentException
Tries to look up the give type in the instance cache. If the instance cache does not yet contain an instance of the given type, the method tries to find exactly ONE implementation of the given type. The method creates a new instance using dependency injection.
type - a type to look up or create an instance for. Must not be nullIllegalArgumentExceptionpublic String[] registerStringLiteralArray(String key, String[] arrayValue)
Copyright © 2014. All rights reserved.