private static void writeListContent(List<ObjectBinding> value, Set<String> beansProcessed, StringBuffer buffer, int indent) {
pad(indent, buffer);
buffer.append("<list>\n");
if (value != null) {
for (ObjectBinding ref : value) {
BeanDescriptor descriptor = ref.getDescriptor();
if (descriptor.getType() == BeanDescriptor.TYPE_BASE) {
writeSimplePropertyValue(ref, buffer, indent + 1);
} else if (ref.getDescriptor().getType() == BeanDescriptor.TYPE_LIST) {
writeListContent(ref.getDescriptor().getListProperty(BeanDescriptor.PROPERTY_CONTENT), beansProcessed, buffer, indent + 1);
} else if (ref.getDescriptor().getType() == BeanDescriptor.TYPE_SET) {
writeSetContent(ref.getDescriptor().getSetProperty(BeanDescriptor.PROPERTY_CONTENT), beansProcessed, buffer, indent + 1);
} else if (ref.getDescriptor().getType() == BeanDescriptor.TYPE_MAP) {
writeMapContent(ref.getDescriptor().getMapProperty(BeanDescriptor.PROPERTY_CONTENT), beansProcessed, buffer, indent + 1);
} else {
if (ref.isNested() && !beansProcessed.contains(ref.getDescriptor().getId())) {
writeBean(descriptor, buffer, beansProcessed, indent + 1);
} else {
writeRef(descriptor.getId(), buffer, indent + 1);
}
}
}
}
pad(indent, buffer);