org.apache.felix.ipojo.extender.internal.builder

## Class ReflectiveFactoryBuilder

- java.lang.Object
- - org.apache.felix.ipojo.extender.internal.builder.ReflectiveFactoryBuilder

All Implemented Interfaces:
  FactoryBuilder

    public class ReflectiveFactoryBuilder
    extends java.lang.Object
    implements FactoryBuilder

An Factory builder using a reflective call to build the factory.

This builder is compatible with the original iPOJO method consisting in calling a constructor receiving the bundle context and the metadata as parameters.

This factory builder need the constructor to be called.

### Constructor Summary

Constructors
Constructor and Description
`ReflectiveFactoryBuilder(java.lang.reflect.Constructor<? extends IPojoFactory> constructor)` Creates the factory builder.

### Method Summary

All Methods Instance Methods Concrete Methods
`IPojoFactory` `build(org.osgi.framework.BundleContext bundleContext, org.apache.felix.ipojo.metadata.Element metadata)` Calls the wrapped constructor to create an iPOJO factory.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ReflectiveFactoryBuilder

    public ReflectiveFactoryBuilder(java.lang.reflect.Constructor<? extends IPojoFactory> constructor)

Creates the factory builder.

Parameters:
  `constructor` - the constructor that will be called when a new component factory will be created.

### Method Detail

#### build

    public IPojoFactory build(org.osgi.framework.BundleContext bundleContext,
                              org.apache.felix.ipojo.metadata.Element metadata)
                       throws FactoryBuilderException

Calls the wrapped constructor to create an iPOJO factory.

Specified by:
  `build` in interface `FactoryBuilder`
Parameters:
  `bundleContext` - the bundle context of the bundle declaring the component type
  `metadata` - the metadata of the component type (`component` element).
Returns:
  the created iPOJO factory
Throws:
  `FactoryBuilderException` - if the constructor cannot be called or throws an error.