void (@NotNull Object result, @NotNull XmlElement element) { int attributeBindingCount = 0; for (NestedBinding binding : bindings) { if (binding instanceof AttributeBinding) { attributeBindingCount++; AttributeBinding attributeBinding = (AttributeBinding)binding; String value = element.attributes.get(attributeBinding.name); if (value != null) { attributeBinding.set(result, value); } } else if (element.content != null && binding instanceof TextBinding) { ((TextBinding)binding).set(result, element.content); } } if (attributeBindingCount == bindings.length) { return; } LinkedHashMap<NestedBinding, List<XmlElement>> data = null; nextNode: for (XmlElement child : element.children) { for (NestedBinding binding : bindings) { if (binding instanceof AttributeBinding || binding instanceof TextBinding || !binding.isBoundTo(child)) { continue; } if (binding instanceof MultiNodeBinding && ((MultiNodeBinding)binding).isMulti()) { if (data == null) { data = new LinkedHashMap<>(); } data.computeIfAbsent(binding, it -> new ArrayList<>()).add(child); } else { binding.deserializeUnsafe(result, child); } continue nextNode; } } for (Binding binding : bindings) { if (binding instanceof AccessorBindingWrapper && ((AccessorBindingWrapper)binding).isFlat) { binding.deserializeUnsafe(result, element); } } if (data != null) { for (NestedBinding binding : data.keySet()) { ((MultiNodeBinding)binding).deserializeList2(result, data.get(binding)); } } }