I am using Java Reflection to initialize different types of objects. All of these objects are constructed the same way (namely, I pass in the same values to construct them).

Thus, my injector looks through each of the fields, and does a long if/else statement like the following:

```
if (Foo.class.isAssignableFrom(field.getType())
   return new Foo(values);
else if (Bar.class.isAssignableFrom(field.getType())
   return new Bar(values);
else if...//Continue over and over

```

I can't define an interface that requires the class to have a factory, because factories are static by nature. The same holds true for extending an abstract class.

Is there some way I can remove the above if/else statement so my injecting class has no idea about the classes that need injecting (besides the fact that it can be constructed with `values`?