private void bindValue(Bindable<?> target, Collection<Object> collection, ResolvableType aggregateType, ResolvableType elementType, Object value) { if (value instanceof String && !StringUtils.hasText((String) value)) { return; } Object aggregate = convert(value, aggregateType, target.getAnnotations()); ResolvableType collectionType = ResolvableType .forClassWithGenerics(collection.getClass(), elementType); Collection<Object> elements = convert(aggregate, collectionType); collection.addAll(elements); }
public <T> T convert(Object result, Bindable<T> target) { return convert(result, target.getType(), target.getAnnotations()); }
private static void echo(Bindable<?> bindable) { System.out.printf("Bindable type = %s , boxedType = %s , value = %s , annotations = %s\n", bindable.getType(), bindable.getBoxedType(), bindable.getValue().get(), Arrays.asList(bindable.getAnnotations())); } }