@Test public void shouldExtractTargetTypeFromGenericDefinition() { Object targetType = new ComponentFactoryIntrospector().targetTypeForComponentFactory(MyFactory.class); assertEquals(NeedsCustomInstantiation.class, targetType); }
public Class<?> targetTypeForComponentFactory(Class<?> type) { Class<?> c = targetTypeForComponentFactory0(type); if (c == null) { throw new ComponentRegistrationException("Class does not implements ComponentFactory " + type); } return c; }
ComponentFactoryIntrospector { public Class<?> targetTypeForComponentFactory(Class<?> type) { Class<?> c = targetTypeForComponentFactory0(type); if (c == null) { throw new ComponentRegistrationException("Class does not implements ComponentFactory " + type); } return c; } }
ComponentFactoryIntrospector { public Class<?> targetTypeForComponentFactory(Class<?> type) { Class<?> c = targetTypeForComponentFactory0(type); if (c == null) { throw new ComponentRegistrationException("Class does not implements ComponentFactory " + type); } return c; }  }
ComponentFactoryIntrospector { public Class<?> targetTypeForComponentFactory(Class<?> type) { Class<?> c = targetTypeForComponentFactory0(type); if (c == null) { throw new ComponentRegistrationException("Class does not implements ComponentFactory " + type); } return c; }  Class<?> targetTypeForComponentFactory(Class<?> type); }
ComponentFactoryIntrospector { public Class<?> targetTypeForComponentFactory(Class<?> type) { Class<?> c = targetTypeForComponentFactory0(type); if (c == null) { throw new ComponentRegistrationException("Class does not implements ComponentFactory " + type); } return c; }  Class<?> targetTypeForComponentFactory(Class<?> type);  }