/** * Register a List of Blueprint, Class, or String * class names of Blueprint * * @param blueprints List * @throws RegisterBlueprintException failed to register blueprint */ public void setRegisterBlueprints(Collection blueprints) throws RegisterBlueprintException { for (Object blueprint : blueprints) { if (blueprint instanceof Class) { registerBlueprint((Class) blueprint); } else if (blueprint instanceof String) { registerBlueprint((String) blueprint); } else if (blueprint instanceof String) { registerBlueprint(blueprint); } else { throw new RegisterBlueprintException("Only supports List comprised of Class<Blueprint>, Blueprint, or String className"); } } }
/** * Register a Blueprint from a String Class name * * @param className String */ public void registerBlueprint(String className) throws RegisterBlueprintException { try { registerBlueprint(Class.forName(className)); } catch (ClassNotFoundException e) { throw new RegisterBlueprintException(e); } }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(carBlueprint); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(driverBlueprint); modelFactory.registerBlueprint(userBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(carBlueprint); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(driverBlueprint); modelFactory.registerBlueprint(userBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(carBlueprint); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(driverBlueprint); modelFactory.registerBlueprint(userBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(carBlueprint); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(driverBlueprint); modelFactory.registerBlueprint(userBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
/** * Register Blueprints, autowire them from Spring Context if they have the SpringBlueprint annotation * * @param blueprint Blueprint * @throws RegisterBlueprintException failed to register blueprint */ @Override public void registerBlueprint(Object blueprint) throws RegisterBlueprintException { SpringBlueprint springBlueprint = blueprint.getClass().getAnnotation(SpringBlueprint.class); if ( springBlueprint != null && springBlueprint.autowire() ) { logger.debug( "Autowiring blueprint {}", blueprint ); beanFactory.autowireBean( blueprint ); } super.registerBlueprint(blueprint); } }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(carBlueprint); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(driverBlueprint); modelFactory.registerBlueprint(userBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(carBlueprint); modelFactory.registerBlueprint(driverBlueprint); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(DriverBlueprint.class); modelFactory.registerBlueprint(WheelBlueprint.class); modelFactory.registerBlueprint(OptionBlueprint.class); modelFactory.registerBlueprint(CarBlueprint.class); }
/** * Register a Blueprint from Class * * @param clazz Blueprint class * @throws RegisterBlueprintException failed to register blueprint */ public void registerBlueprint(Class clazz) throws RegisterBlueprintException { Object blueprint = null; try { blueprint = clazz.newInstance(); } catch (InstantiationException e) { throw new RegisterBlueprintException(e); } catch (IllegalAccessException e) { throw new RegisterBlueprintException(e); } registerBlueprint(blueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(optionBlueprint); modelFactory.registerBlueprint(CarBlueprint.class); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(WheelBlueprint.class); modelFactory.registerBlueprint(SpareTireBlueprint.class); modelFactory.registerBlueprint(OptionBlueprint.class); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(wheelBlueprint); modelFactory.registerBlueprint(optionBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(userBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(driverBlueprint); }
@Before public void setUp() throws RegisterBlueprintException { modelFactory = new ModelFactory(); modelFactory.registerBlueprint(userBlueprint); }