public static @NotNull ShelvedChangeList readExternal(@NotNull Element element,
                                                        @NotNull PathMacroSubstitutor pathMacroSubstitutor) throws InvalidDataException {
    Path path = null;
    String description = null;
    for (Map.Entry<String, String> field : readFields(element).entrySet()) {
      if (PATH_FIELD_NAME.equals(field.getKey())) {
        String value = pathMacroSubstitutor.expandPath(field.getValue());
        if (!value.isEmpty()) {
          path = Paths.get(value);
        }
      }
      else if (DESCRIPTION_FIELD_NAME.equals(field.getKey())) {
        description = field.getValue();
      }
    }

    String name = element.getAttributeValue(NAME_ATTRIBUTE, "");
    long time = Long.parseLong(element.getAttributeValue(ATTRIBUTE_DATE));
    boolean isRecycled = Boolean.parseBoolean(element.getAttributeValue(ATTRIBUTE_RECYCLED_CHANGELIST));
    boolean isToDelete = Boolean.parseBoolean(element.getAttributeValue(ATTRIBUTE_TOBE_DELETED_CHANGELIST));
    boolean isDeleted = Boolean.parseBoolean(element.getAttributeValue(ATTRIBUTE_DELETED_CHANGELIST));

    List<Element> children = element.getChildren(ELEMENT_BINARY);
    List<ShelvedBinaryFile> binaryFiles = new ArrayList<>(children.size());
    for (Element child : children) {
      ShelvedBinaryFile binaryFile = ShelvedBinaryFile.readExternal(child, pathMacroSubstitutor);
      binaryFiles.add(binaryFile);
    }

    return new ShelvedChangeList(path, name, description, time, isRecycled, isToDelete, isDeleted, binaryFiles);
  }
public static @NotNull ShelvedChangeList readExternal(@NotNull Element element,
                                                        @NotNull PathMacroSubstitutor pathMacroSubstitutor)