/** * Get complete inherited list of Field for Class, with the exception * that ConstructorCallback fields are not inherited. * * @param clazz Class * @return Map */ private Map<String,Field> getAllFields(Class clazz) { return this.getAllFields(clazz, false); }
/** * Create a Model for a registered Blueprint. Values set in the * model will not be overridden by defaults in the Blueprint. * * @param <T> model Class * @param referenceModel Object * @return Model * @throws CreateModelException model failed to create */ public <T> T createModel(T referenceModel) throws CreateModelException { return createModel(referenceModel, true); }
public void setModelFields(Collection<ModelField> modelFields) { for( ModelField modelField: modelFields ) { addModelField(modelField); } }
@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 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"); } } }
/** * Create a Model for a registered Blueprint * * @param <T> model Class * @param clazz Model class * @param withPolicies boolean if Policies should be applied to the create * @return Model * @throws CreateModelException model failed to create */ public <T> T createModel(Class<T> clazz, boolean withPolicies) throws CreateModelException { Erector erector = erectors.get(clazz); if (erector == null) { throw new CreateModelException("Unregistered class: " + clazz); } return createModel(erector, null, withPolicies); }
protected Object createNewInstance(Erector erector) throws BlueprintTemplateException { return erector.createNewInstance(); }
public void addCommands(ModelField modelField, Set<Command> commands) { for( Command command : commands ) { addCommand( modelField, command ); } }
@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 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); } }
/** * Create a Model for a registered Blueprint * * @param <T> model Class * @param clazz Model class * @return Model * @throws CreateModelException model failed to create */ public <T> T createModel(Class<T> clazz) throws CreateModelException { return createModel(clazz, true); }
@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 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(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); }
@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); }