public <U> void setProperty(String name, U value) m_properties.put(name, new PropertyType(name, value, String.class)); }
public BindableListWrapper(List<M> list) { Assert.notNull(list); if (list instanceof BindableListWrapper) { throw new IllegalArgumentException("Wrap a BindableListWrapper in a BindableListWrapper."); } this.list = list; for (int i = 0; i < this.list.size(); i++) { this.list.set(i, (M) convertToProxy(this.list.get(i))); } agent = new BindableProxyAgent<List<M>>(this, list); agent.propertyTypes.put("this", new PropertyType(List.class, true, true)); }
public BindableListWrapper(List<M> list) { Assert.notNull(list); if (list instanceof BindableListWrapper) { throw new IllegalArgumentException("Wrap a BindableListWrapper in a BindableListWrapper."); } this.list = list; for (int i = 0; i < this.list.size(); i++) { this.list.set(i, (M) convertToProxy(this.list.get(i))); } agent = new BindableProxyAgent<List<M>>(this, list); agent.propertyTypes.put("this", new PropertyType(List.class, true, true)); }
public MapPropertyType getModeldefinitionFor(MultipleSubFormFieldDefinition subFormField, MapModelRenderingContext context, Map<String, Map<String, PropertyType>> availableModels) { FormDefinition creationForms = context.getAvailableForms().get(subFormField.getCreationForm()); Map<String, PropertyType> modelDefinition = generateModelDefinition(creationForms, context, availableModels); FormDefinition editionForm = context.getAvailableForms().get(subFormField.getCreationForm()); modelDefinition.putAll(generateModelDefinition(editionForm, context, availableModels)); modelDefinition.put(MapModelRenderingContext.FORM_ENGINE_OBJECT_IDX, new PropertyType(Integer.class)); modelDefinition.put(MapModelRenderingContext.FORM_ENGINE_EDITED_OBJECT, new PropertyType(Boolean.class)); return new MapPropertyType(modelDefinition); } }
protected Map<String, PropertyType> generateModelDefinition(FormDefinition form, MapModelRenderingContext context, Map<String, Map<String, PropertyType>> availableModels) { if (availableModels.containsKey(form.getId())) { return availableModels.get(form.getId()); } Map<String, PropertyType> formTypes = new HashMap<>(); availableModels.put(form.getId(), formTypes); form.getFields().forEach(field -> { PropertyType propertyType = null; if (basicProperties.containsKey(field.getStandaloneClassName())) { propertyType = new PropertyType(basicProperties.get(field.getStandaloneClassName())); } else if (propertiesGenerator.containsKey(field.getClass())) { PropertyGenerator generator = propertiesGenerator.get(field.getClass()); propertyType = generator.generatePropertyType(field); } else if (field instanceof SubFormFieldDefinition) { propertyType = getModeldefinitionFor((SubFormFieldDefinition) field, context, availableModels); } else if (field instanceof MultipleSubFormFieldDefinition) { propertyType = new PropertyType(List.class); } if (propertyType != null) { formTypes.put(field.getBinding(), propertyType); } }); return formTypes; }
final PropertyType property = new PropertyType(); m_collection.getProperty().add(property); final DefaultHandler handler = new PropertyHandler(m_elementStack, property, attributes, m_parser, this);