List<ArrangementGroupingRule> (@NotNull Element element, @Nullable ArrangementSettings defaultSettings) { Element groups = element.getChild(GROUPS_ELEMENT_NAME); if (groups == null) { return defaultSettings == null ? new SmartList<>() : defaultSettings.getGroupings(); } final List<ArrangementGroupingRule> groupings = new ArrayList<>(); for (Element group : groups.getChildren(GROUP_ELEMENT_NAME)) { // Grouping type. String groupingTypeId = group.getChildText(TYPE_ELEMENT_NAME); ArrangementSettingsToken groupingType = StdArrangementTokens.byId(groupingTypeId); if (groupingType == null) { groupingType = myMixin.deserializeToken(groupingTypeId); } if (groupingType == null) { LOG.warn(String.format("Can't deserialize grouping type token by id '%s'", groupingTypeId)); continue; } // Order type. String orderTypeId = group.getChildText(ORDER_TYPE_ELEMENT_NAME); ArrangementSettingsToken orderType = StdArrangementTokens.byId(orderTypeId); if (orderType == null) { orderType = myMixin.deserializeToken(orderTypeId); } if (orderType == null) { LOG.warn(String.format("Can't deserialize grouping order type token by id '%s'", orderTypeId)); continue; } groupings.add(new ArrangementGroupingRule(groupingType, orderType)); } return groupings; }