Package mireka.startup
Class InjectableObjectContainer
- Object
-
- mireka.startup.InjectableObjectContainer
-
public class InjectableObjectContainer extends ObjectInjectableObjectContainer maintains a collection of objects which were provided as possible default values for unassigned, injectable properties of configuration objects. It can retrieve the default object which suits the requested type.
-
-
Constructor Summary
Constructors Constructor Description InjectableObjectContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Object defaultObject)Registers the supplied object as a default object.Objectget(Class<?> type)Returns the default object which is suitable for the specified type.
-
-
-
Method Detail
-
add
public void add(Object defaultObject)
Registers the supplied object as a default object.- Parameters:
defaultObject- The object to be registered
-
get
public Object get(Class<?> type) throws IllegalArgumentExceptionReturns the default object which is suitable for the specified type.- Parameters:
type- The type for which a default object is requested.- Returns:
- The single suitable object which was found.
- Throws:
IllegalArgumentException- if zero or more than one object has been registered which is assignable to the specified type.
-
-