org.apache.felix.ipojo

## Interface ConstructorInjector

All Known Implementing Classes:
  ArchitectureHandler, BundleContextHandler, ConfigurationHandler, ControllerHandler, Dependency, DependencyHandler, LifecycleCallbackHandler, PrimitiveHandler, Property, ProvidedServiceHandler

    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.

Author:
  Felix Project Team

### Method Summary

All Methods Instance Methods Abstract Methods
`java.lang.Object` `getConstructorParameter(int index)` Gets the object to inject in the constructor parameter.
`java.lang.Class` `getConstructorParameterType(int index)` Gets the type of the object to inject in the constructor parameter.

### Method Detail

#### getConstructorParameter

    java.lang.Object getConstructorParameter(int index)

Gets the object to inject in the constructor parameter.

Parameters:
  `index` - the parameter index
Returns:
  the object to be injected.

#### getConstructorParameterType

    java.lang.Class getConstructorParameterType(int index)

Gets the type of the object to inject in the constructor parameter. This is the type looked into the Pojo class, so it must match. Returning `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.

Parameters:
  `index` - the parameter index
Returns:
  the Class object (must fit also for primitive type)