@Test public void testCreateWithInstance4() { Foo foo = newOf( fooType, "bar", map("class", "org.boon.di.CreatorTest$Bar", "name", "barFromMap") ); boolean ok = foo != null || die(); ok = foo.bar != null || die(); ok = foo.bar.name.equals( "barFromMap" ) || die(); }
public static <T> T newOf( Class<T> type, Object... args ) { Map<?, ?> map = Maps.mapFromArray( args ); Context context = DependencyInjection.fromMap(map); context.add( DependencyInjection.classes(type) ); return context.get( type ); }
Creator { public static <T> T newOf( Class<T> type, Object... args ) { Map<?, ?> map = Maps.mapFromArray( args ); Context context = DependencyInjection.fromMap(map); context.add( DependencyInjection.classes(type) ); return context.get( type ); } }
Creator { public static <T> T newOf( Class<T> type, Object... args ) { Map<?, ?> map = Maps.mapFromArray( args ); Context context = DependencyInjection.fromMap(map); context.add( DependencyInjection.classes(type) ); return context.get( type ); }  }
Creator { public static <T> T newOf( Class<T> type, Object... args ) { Map<?, ?> map = Maps.mapFromArray( args ); Context context = DependencyInjection.fromMap(map); context.add( DependencyInjection.classes(type) ); return context.get( type ); }  static T create(Class<T> type, Map<?, ?> map); static T create(Class<T> type, Context context); static T newOf( Class<T> type, Object... args ); }
Creator { public static <T> T newOf( Class<T> type, Object... args ) { Map<?, ?> map = Maps.mapFromArray( args ); Context context = DependencyInjection.fromMap(map); context.add( DependencyInjection.classes(type) ); return context.get( type ); }  static T create(Class<T> type, Map<?, ?> map); static T create(Class<T> type, Context context); static T newOf( Class<T> type, Object... args );  }