PyUserNodeRenderer (final @NotNull Element element) { PyUserNodeRenderer renderer = new PyUserNodeRenderer(false, null); String name = toString(JDOMExternalizerUtil.readField(element, NAME)); boolean isEnabled = toBoolean(JDOMExternalizerUtil.readField(element, IS_ENABLED)); @NotNull String toType = toString(JDOMExternalizerUtil.readField(element, TO_TYPE)); @NotNull String typeCanonicalImportPath = toString(JDOMExternalizerUtil.readField(element, TYPE_CANONICAL_IMPORT_PATH)); @NotNull String typeQualifiedName = toString(JDOMExternalizerUtil.readField(element, TYPE_QUALIFIED_NAME)); @NotNull String typeSourceFile = toString(JDOMExternalizerUtil.readField(element, TYPE_SOURCE_FILE)); renderer.setName(name); renderer.setEnabled(isEnabled); renderer.setToType(toType); renderer.setTypeCanonicalImportPath(typeCanonicalImportPath); renderer.setTypeQualifiedName(typeQualifiedName); renderer.setTypeSourceFile(typeSourceFile); @Nullable Element valueRendererElement = element.getChild(VALUE_RENDERER_TAG); if (valueRendererElement != null) { boolean isDefault = toBoolean(JDOMExternalizerUtil.readField(valueRendererElement, IS_DEFAULT)); @NotNull String expression = toString(JDOMExternalizerUtil.readField(valueRendererElement, EXPRESSION)); renderer.getValueRenderer().setDefault(isDefault); renderer.getValueRenderer().setExpression(expression); } @Nullable Element childrenRendererElement = element.getChild(CHILDREN_RENDERER_TAG); if (childrenRendererElement != null) { boolean isDefault = toBoolean(JDOMExternalizerUtil.readField(childrenRendererElement, IS_DEFAULT)); boolean appendDefaultChildren = toBoolean(JDOMExternalizerUtil.readField(childrenRendererElement, APPEND_DEFAULT_CHILDREN)); ArrayList<PyUserNodeRenderer.ChildInfo> list = new ArrayList<>(); for (Element childElement : childrenRendererElement.getChildren(CHILD_TAG)) { @NotNull String expression = toString(JDOMExternalizerUtil.readField(childElement, EXPRESSION)); list.add(new PyUserNodeRenderer.ChildInfo(expression)); } renderer.getChildrenRenderer().setDefault(isDefault); renderer.getChildrenRenderer().setAppendDefaultChildren(appendDefaultChildren); renderer.getChildrenRenderer().setChildren(list); } return renderer; }