|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConstructorInjector
Interface implemented to support constructor parameter injection.
When a new POJO object has to be created, all constructor injectors are
called to gets the objects to injects as well as the type (to discover
the constructor).
Handlers willing to inject constructor parameters must register themselves
using InstanceManager.register(int, ConstructorInjector)
where
the integer is the parameter index. Only one injector can inject a value
for a specific index. If several injectors are registered for the same index,
the component type is declared as invalid.
Method Summary | |
---|---|
Object |
getConstructorParameter(int index)
Gets the type of the object to inject in the constructor parameter. |
Class |
getConstructorParameterType(int index)
Gets the type of the object to |
Method Detail |
---|
Object getConstructorParameter(int index)
null
will try to get the class from the
injected object, however this can be wrong (implementation instead of interface,
boxed objects...) and error-prone.
index
- the parameter index
Class getConstructorParameterType(int index)
index
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |