Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -392,34 +392,6 @@ private static String getChildCombinationMode(Map<String, String> attributes) {
return !isEmpty(value) ? value : DEFAULT_CHILDREN_COMBINATION_MODE;
}

@Nullable
private static XmlNode findNodeById(@Nonnull List<XmlNode> nodes, @Nonnull String id) {
return nodes.stream()
.filter(n -> id.equals(n.attribute(ID_COMBINATION_MODE_ATTRIBUTE)))
.findFirst()
.orElse(null);
}

@Nullable
private static XmlNode findNodeByKeys(
@Nonnull List<XmlNode> nodes, @Nonnull XmlNode target, @Nonnull String[] keys) {
return nodes.stream()
.filter(n -> matchesKeys(n, target, keys))
.findFirst()
.orElse(null);
}

private static boolean matchesKeys(@Nonnull XmlNode node1, @Nonnull XmlNode node2, @Nonnull String[] keys) {
for (String key : keys) {
String value1 = node1.attribute(key);
String value2 = node2.attribute(key);
if (!Objects.equals(value1, value2)) {
return false;
}
}
return true;
}

static class IndentingXMLStreamWriter extends StreamWriterDelegate {

int depth = 0;
Expand Down