protected void addProperty(String name, String type) { FormPropertyConfig propConfig = new FormPropertyConfig(); propConfig.setName(name); propConfig.setType(type); formBeanConfig.addFormPropertyConfig(propConfig); }
newBeanConfig.addFormPropertyConfig(fpc[i]);
newBeanConfig.addFormPropertyConfig(fpc[i]);
/** * <p>Compare the form properties of this bean with that of the given and * copy those that are not present.</p> * * @param config The form bean config to copy properties from. * @see #inheritFrom(FormBeanConfig) */ protected void inheritFormProperties(FormBeanConfig config) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException { throwIfConfigured(); // Inherit form property configs FormPropertyConfig[] baseFpcs = config.findFormPropertyConfigs(); for (int i = 0; i < baseFpcs.length; i++) { FormPropertyConfig baseFpc = baseFpcs[i]; // Do we have this prop? FormPropertyConfig prop = this.findFormPropertyConfig(baseFpc.getName()); if (prop == null) { // We don't have this, so let's copy it prop = (FormPropertyConfig) RequestUtils.applicationInstance(baseFpc.getClass() .getName()); BeanUtils.copyProperties(prop, baseFpc); this.addFormPropertyConfig(prop); prop.setProperties(baseFpc.copyProperties()); } } }