Custom settings for xml formatting

I can not accept custom settings for reformatting the xml file.

CodeStyleSettings settings = CodeStyle.getSettings(project);
CodeStyleSettings cloneSettings = settings.clone();
XmlCodeStyleSettings xmlCodeStyleSettings = cloneSettings.getCustomSettings(XmlCodeStyleSettings.class);
xmlCodeStyleSettings.XML_ATTRIBUTE_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM;

WriteAction.run(() -> CodeStyle.doWithTemporarySettings(project, cloneSettings, () ->
CodeStyleManager.getInstance(project)
.reformatText(descriptorFile, 0, descriptorFile.getTextLength())));

'XML_ATTRIBUTE_WRAP' property not accept.

Please sign in to leave a comment.