ab.setDescriptor(node.descriptor);
for (Entry<String, Object> entry : leaf.value.entrySet()) {
PropertyDescriptor descriptor = Types.findDescriptor(type, entry.getKey());
if (descriptor == null) {
throw new IllegalArgumentException("Cannot find descriptor for attribute "
+ entry.getKey() + " in type " + type.getName().toString());
}
ab.add(null, entry.getValue(), descriptor.getName());
}
Attribute att = ab.build();