private static <T> BindableProxy<T> doDeepClone(T instance) { final BindableProxy<T> proxy; if(instance instanceof BindableProxy) { proxy = (BindableProxy<T>) instance; } else { proxy = (BindableProxy<T>) BindableProxyFactory.getBindableProxy(instance); } if(proxy != null) { proxy.getBeanProperties() .entrySet() .stream() .filter(entry -> isProxy(entry.getValue().getType())) .forEach(entry -> deepCloneProxyProperty(proxy, entry.getKey(), entry.getValue())); } return proxy; }
private static PropertyType getPropertyType(final BindableProxy<?> proxy, final String property) { final BindableProxyAgent<?> agent = proxy.getBindableProxyAgent(); if (property.contains(".")) { final int firstDot = property.indexOf("."); final String topLevelProperty = property.substring(0, firstDot); final String childProperty = property.substring(firstDot+1); final PropertyType topLevelType = getPropertyType(proxy, topLevelProperty); final BindableProxy<?> topLevelProxy; if (topLevelType instanceof MapPropertyType) { topLevelProxy = (BindableProxy<?>) DataBinder.forMap(((MapPropertyType) topLevelType).getPropertyTypes()).getModel(); } else { topLevelProxy = BindableProxyFactory.getBindableProxy(topLevelType.getType().getName()); } return getPropertyType(topLevelProxy, childProperty); } else if (agent.propertyTypes.containsKey(property)) { return agent.propertyTypes.get(property); } else { final String type = proxy.getClass().getSuperclass().getSimpleName(); throw new NonExistingPropertyException(type, property); } }
private static PropertyType getPropertyType(final BindableProxy<?> proxy, final String property) { final BindableProxyAgent<?> agent = proxy.getBindableProxyAgent(); if (property.contains(".")) { final int firstDot = property.indexOf("."); final String topLevelProperty = property.substring(0, firstDot); final String childProperty = property.substring(firstDot+1); final PropertyType topLevelType = getPropertyType(proxy, topLevelProperty); final BindableProxy<?> topLevelProxy; if (topLevelType instanceof MapPropertyType) { topLevelProxy = (BindableProxy<?>) DataBinder.forMap(((MapPropertyType) topLevelType).getPropertyTypes()).getModel(); } else { topLevelProxy = BindableProxyFactory.getBindableProxy(topLevelType.getType().getName()); } return getPropertyType(topLevelProxy, childProperty); } else if (agent.propertyTypes.containsKey(property)) { return agent.propertyTypes.get(property); } else { final String type = proxy.getClass().getSuperclass().getSimpleName(); throw new NonExistingPropertyException(type, property); } }
logger.debug("Binding property {} to component {}", property, component); final Converter converter = findConverter(property, getPropertyType(property).getType(), component, providedConverter); logger.debug("Using converter: {} <--> {}", converter.getModelType().getSimpleName(), converter.getComponentType().getSimpleName());
logger.debug("Binding property {} to component {}", property, component); final Converter converter = findConverter(property, getPropertyType(property).getType(), component, providedConverter); logger.debug("Using converter: {} <--> {}", converter.getModelType().getSimpleName(), converter.getComponentType().getSimpleName());
type = hasProperties.getBeanProperties().get(meta.getProperty()).getType().getName();